Even when the script runs it has errors.
Code: Select all
C:\>powershell.exe c:\temp\resourcecheck.ps1
Get-WmiObject : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
At C:\temp\resourcecheck.ps1:11 char:63
+ $TotalRAM = (get-WMIObject win32_operatingsystem -computername <<<< $servername | Measure-Object TotalVisibleMemorySize -sum).sum / 1024
+ CategoryInfo : InvalidData: (:) [Get-WmiObject], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetWmiObjectCommand