Skip to content

Instantly share code, notes, and snippets.

@kvprasoon
Last active August 29, 2015 14:24
Show Gist options
  • Save kvprasoon/1486c5fea136d78b52bc to your computer and use it in GitHub Desktop.
Save kvprasoon/1486c5fea136d78b52bc to your computer and use it in GitHub Desktop.
Get Bios Serialnumber,PSComputername,Version,ServicepackMajorversion
foreach($O in "Win32_operatingsystem","win32_bios"){if($O -eq "win32_bios"){$r+=(gwmi $O|select @{E="Serialnumber";L="BIOS Serialnumber"},Pscomputername,@{E={$r.servicepackmajorversion};L="servicepackmajorversion"},@{E={$R.version};L="version"})} else{[array]$r+=(gwmi $O|select @{E={""};L="Serialnumber"},Pscomputername,servicepackmajorversion,version)};$R[1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment