Skip to content

Instantly share code, notes, and snippets.

@aadennis
Created September 23, 2020 07:40
Show Gist options
  • Save aadennis/069cd26d995a78428aefb9b4fcdaca1b to your computer and use it in GitHub Desktop.
Save aadennis/069cd26d995a78428aefb9b4fcdaca1b to your computer and use it in GitHub Desktop.
Return Windows info, typically for confirming OS in a container
function Get-WindowsInfo() {
Write-Host "Hostname: $(& HOSTNAME.EXE)"
systeminfo /fo csv | ConvertFrom-Csv | Select-Object OS*, System*, Hotfix* | Format-List
write-host "Semantic file version..."
(Get-ItemProperty -Path C:\Windows\System32\hal.dll).VersionInfo.FileVersion
# Write-host "OS Caption..." - redundant
# (Get-WmiObject -Class win32_OperatingSystem).Caption
}
Get-WindowsInfo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment