Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Foreach statement only outputing the last server in the list.

$
0
0
The output is only bringing in the last server data.
Don't  know what i'm missing.
Clear-Host$machines=gcc:\temp\pcs.txtforeach ($machinein$machines){Get-HotFix-ComputerName$machine | where { $_.installedon -gt [datetime]'03/15/2015'}
| select-object pscomputername, description, hotfixid, installedon |Export-Csvc:\temp\pcpatching.csv-Append-NoTypeInformation
}

Viewing all articles
Browse latest Browse all 6937

Trending Articles