Created
October 19, 2018 13:03
-
-
Save mattslay/4ca9e62f69fb0e18006b8e0675e73a09 to your computer and use it in GitHub Desktop.
PowerShell - Query software installed on list of machines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$machines = 'MSPC5', 'JRPC5', 'CWPC5', 'RPPC5', 'TMPC4', 'MIPC5', 'TWPC5', 'JBPC5', 'DNC2', 'FS6-VM1', '192.168.0.60' | |
foreach ($machine in $machines) | |
{ | |
trap{"$machine`: not reachable or not running WsMan"; continue} | |
if(test-wsman -ComputerName $machine -ea stop){ | |
$result = gcim -Class CIM_Product -Filter 'Name like "%DWG%"' | | |
select name, version | |
Write-Host $machine $result.name, $result.version | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment