$ret = hostname Write-Output ("Host name: $ret") $ret = (Get-WmiObject Win32_OperatingSystem).Caption Write-Output ("OS name: $ret") $ret = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").CurrentBuild + "." +(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").UBR Write-Output ("OS build: $ret") $ret |Out-File -FilePath C:\postosbuild.txt