Created
February 7, 2018 16:21
-
-
Save royashbrook/eda182f4217f2656001c24de0210752a to your computer and use it in GitHub Desktop.
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
##Inventory a list of machines: | |
"server1","server2" | % { | |
$c = $_ #var to hold computer name | |
$o = @() #hashtable to hold results | |
$o += Get-WmiObject -ComputerName $c -Class Win32_OperatingSystem | |
$o += Get-WmiObject -ComputerName $c -Class Win32_BIOS | |
$o += Get-WmiObject -ComputerName $c -Class Win32_ComputerSystem | |
$o += Get-WmiObject -ComputerName $c -Class Win32_Processor | |
$o += Get-WmiObject -ComputerName $c -Class Win32_LogicalDisk | Where-Object {$_.DriveType -eq 3} | |
$o | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment