This file contains hidden or 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
# ドライブの使用状況を取得する | |
$diskUsage = Get-WmiObject Win32_LogicalDisk | Where-Object { $_.DriveType -eq 3 } | ForEach-Object { | |
[PSCustomObject]@{ | |
'Drive' = $_.DeviceID | |
'UsedSpaceGB' = [math]::Round((($_.Size - $_.FreeSpace) / 1GB), 2) | |
'FreeSpaceGB' = [math]::Round(($_.FreeSpace / 1GB), 2) | |
'TotalSpaceGB' = [math]::Round(($_.Size / 1GB), 2) | |
} | |
} |
OlderNewer