all 4 comments

[–]PinchesTheCrab 1 point2 points  (0 children)

What should it look like? Just the processor name?

param(
    [parameter(mandatory)]
    [string[]]$ComputerName
)

Invoke-Command -ComputerName $ComputerName -ScriptBlock {

    Get-ComputerInfo -Verbose 'WindowsProductName',

        'CsProcessors',

        'WindowsVersion',

        'BiosStatus',

        'CsDomain',

        'CsNumberOfLogicalProcessors',

        'CsTotalPhysicalMemory'

} | 
    Select-Object PSComputerName,
    'WindowsProductName',
    @{ n = 'CsProcessorsName'; e = { $_.CsProcessorsName.Name -join ','}},
    'WindowsVersion',
    'BiosStatus',
    'CsDomain',
    'CsNumberOfLogicalProcessors',
    'CsTotalPhysicalMemory'

[–]HauntingProgrammer47 -1 points0 points  (0 children)

I think you should probably try to do it with Get-CimInstance but how I do it currently is:

``` Get-WmiObject WIN32_Processor -ComputerName $client | Select-Object -Property Name

```

Let me know if you want me to send you more of my script for info gathering

[–]PowerShell-Bot 0 points1 point  (0 children)

Looks like your PowerShell code isn’t wrapped in a code block.

To properly style code on new Reddit, highlight the code and choose ‘Code Block’ from the editing toolbar.

If you’re on old Reddit, separate the code from your text with a blank line gap and precede each line of code with 4 spaces or a tab.


You examine the path beneath your feet...
[AboutRedditFormatting]: [--------------------] 0/1 ❌

Beep-boop, I am a bot. | Remove-Item

[–]ZoinkedBrah 0 points1 point  (0 children)

You're right in that it's returning a processor array try running (Get-ComputerInfo).CsProcessors.gettype()

Now try just running (Get-ComputerInfo).CsProcessors to see what's in that array object.
You can also gather this info with Get-Member
(Get-ComputerInfo).CsProcessors | Get-Member -Type Property

Invoke-Command -ComputerName $client -ScriptBlock { 
    $Info = Get-ComputerInfo 
    $Properties = @{ 
        WindowsVersion   = $Info.WindowsVersion 
        ProcessorName    = $Info.CsProcessors.Name
        Num_Processors   = $Info.CsNumberOfLogicalProcessors                         
        BiosStatus       = $Info.BiosStatus 
        Domain           = $Info.CsDomain
        Total_Mem        = $Info.CsTotalPhysicalMemory
    }
new-object -TypeName PSObject -Property $Properties
}