I can’t add number objects

I have the following code:

$i = Get-wmiobject win32-processor -ComputerName $_ $i = [int]$i.NumberOfCores $amount = amount + $i 

This gets executed for a list of Servernames. I want to know how many processor cores there are in total.

When I execute:

Out-String -InputObject $i 

I get the number of cores but when I add them to the $amount variable I only get a String of all the numbers. I think the solution is very simple but I can’t find a solution anywhere. Please help.

Edit:

Out-String -InputObject $anzahl 'First Number' 'Second Number' ... 

submitted by /u/aemmeroli
[link] [comments]

Leave a Reply