Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple PowerShell function to retrieve OS info from a Windows machine.
function Get-MachineInfo($ServerName="localhost")
{
Get-WmiObject win32_computersystem -ComputerName $ServerName |
SELECT DNSHostName,
Manufacturer,
Model,
SystemType,
@{Name="TotalPhysicalMemoryInMB";Expression={"{0:n2}" -f($_.TotalPhysicalMemory/1mb)}},
NumberOfLogicalProcessors,
NumberOfProcessors,
CurrentTimeZone,
DaylightInEffect
}# End Get-MachineInfo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.