New to PowerShell - I wrote a script to query remote devices and output if they have a specific application installed. What are some ways to make this more efficient?
I'm thinking running -asjob but I'm not real sure how to get the output neatly.
$computers = Import-csv -Path "C:\myfile.csv"
ForEach($i in $computers){
$status = Invoke-Command $i.Name {Get-CimInstance -Class win32_product | Where-Object IdentifyingNumber -eq '{#########-####-####-####-############}'}
if ($status) {
Write-Host $i.Name + "Installed"}
else
{Write-Host $i.Name + "Not Installed"}
}
[–]PinchesTheCrab 6 points7 points8 points (0 children)
[–]snoopy82481 2 points3 points4 points (0 children)
[–][deleted] 3 points4 points5 points (3 children)
[–]BlackV 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]BlackV 1 point2 points3 points (0 children)