Posts

Showing posts with the label Uptime

PowerShell: Check Windows OS Version

Image
Here is a PowerShell script to get the OS details of Windows Machines. The script makes use of CIM cmdlets. The script also provides uptime information. function Get-cOSInfo { <# . SYNOPSIS PowerShell script to collect OS information . DESCRIPTION Get the OS, edition, and build version of Windows Servers . PARAMETER ComputerName Accepts a list of computer names or IP addresses . EXAMPLE Get-cOSInfo -ComputerName Server1,server2 . LINK https://www.posh-scripts.in.net/2019/08/check-windows-os-version.html #> [ CmdletBinding ()] Param ( # A computer name or list of computer names [ Parameter ( Mandatory = $ False , ValueFromPipelineByPropertyName = $ true , Position = 0 )] [ string []]$ ComputerName = ' localhost ' , [ Parameter ( Mandatory = $ False , ValueFromPipelineByPropertyName = $ false , Position = 1 )] [ ValidateNotNull ()] [...