Created
March 19, 2019 18:37
-
-
Save SQLvariant/1bcb1a1696d992eb465f04825e2d4f4c to your computer and use it in GitHub Desktop.
Simple PowerShell function to retrieve OS info from a Windows machine.
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-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