Getting Drive space information through PowerShell.
Invoke-Command `
-ComputerName "ServerName"
`
{
Get-WMIObject Win32_Logicaldisk|
Select-Object
PSComputername,DeviceID,@{Name="SizeGB";Expression={$_.Size/1GB -as [int]}},
@{Name="FreeGB";Expression={[math]::Round($_.Freespace/1GB,2)}}
}
`
-Credential "UserNameHere"
Comments