Powershell get-hotfix and export-csv

Soldato
Joined
8 Mar 2005
Posts
3,676
Location
London, UK
I'm truly struggling today;

Feeder file with list of servers
Prompt for KB<numeric>
Checks whether HFB has been applied and reports installer and date details and then exports to simple CSV.

It's pretty much a simple one-liner but I'm going around in circles with the export!

Currently

Code:
Clear-Host
$Machines = "C:\windows\servers.txt"
$Patch = "KB2922229";
#$Patch;Read-Host 'KB<numeric<>'
$Computers = Get-Content $Machines
$temp = $null

ForEach ($Item in $Computers) 
{

$temp +=,(Get-Hotfix $Patch -ComputerName $Item | Select PSComputerName, HotfixID, Description, InstalledBy, InstalledOn | sort InstalledOn) 
}

$path = $temp | Export-Csv 'c:\output.csv'

OK, so this dumps out what I need, however I would like to include rows where the patch isn't installed and also where the server is unavailable/non-reportable.

Cheers, Paul.
 
Last edited:
Soldato
OP
Joined
8 Mar 2005
Posts
3,676
Location
London, UK
No thank you. I need the all assistance I can get! :)

I also need to include where the patch isn't installed and where the server is unreachable (for whatever reason).

Cheers, Paul.
 
Back
Top Bottom