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

Popular posts from this blog

Always On FailOver Events

The transaction log for database is full due to 'OLDEST_PAGE'

SSAS Cube or Database backup with Powershell command "Backup-AsDatabase"