Created
September 23, 2020 07:40
-
-
Save aadennis/069cd26d995a78428aefb9b4fcdaca1b to your computer and use it in GitHub Desktop.
Return Windows info, typically for confirming OS in a container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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