Powershell Function to Get the Windows Version of a Computer

[sourcecode language=”powershell” wraplines=”false”]
#Get Windows version on a specific computer/instance
#Usage: Get-WindowsVersion [ServerName]
Function Get-WindowsVersion
{
param ([string]$computername=$env:computername)
$computername = $computername.toupper()
(Get-WmiObject -ComputerName $computername -Class Win32_OperatingSystem).Caption
}
[/sourcecode]


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *