Skip to content

Instantly share code, notes, and snippets.

@bundyfx
Last active September 10, 2015 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bundyfx/a7b89e4ab970fbff6192 to your computer and use it in GitHub Desktop.
Save bundyfx/a7b89e4ab970fbff6192 to your computer and use it in GitHub Desktop.
$csv = Import-csv C:\Input.csv
$csv.MachineName | ForEach-Object {if(Test-Connection -Count 1 -Quiet $_){ $_ | Select @{N='MACHINENAME';E={Get-WmiObject -cn $_ Win32_OperatingSystem | Select -expand PsC*}},@{N='OSVERSION';E={Get-WmiObject -cn $_ Win32_OperatingSystem | Select -ExpandProperty Cap*}}}} | Export-Csv C:\Output.csv -nti
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment