Skip to content

Instantly share code, notes, and snippets.

@kvprasoon
Created September 7, 2015 17:41
Show Gist options
  • Save kvprasoon/c533b08b4eb174ca7bdd to your computer and use it in GitHub Desktop.
Save kvprasoon/c533b08b4eb174ca7bdd to your computer and use it in GitHub Desktop.
ScriptingGamesSep
$Cred=Get-Credential;import-csv C:\powershell.org\Input.csv|select -ExpandProperty machinename |foreach{new-object psobject -Property @{'MACHIUNENAME'=$_;'OS VERSION'=$(Get-WmiObject -Class win32_operatingsystem -ComputerName $_ -Credential $cred|select -ExpandProperty caption)}}|Export-Csv C:\powershell.org\Output.csv -NoTypeInformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment