[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]
Powershell Function to Get the Windows Version of a Computer
by
Tags:
Leave a Reply