#######################################
# Skrypt PowerShella
# (C) dr Holger Schwichtenberg
# http://www.powershell-doktor.de
########################################


[System.IO.DriveInfo]::GetDrives()
exit

# jeden dysk, lokalny

$dysk = new-object System.IO.DriveInfo("C")
$dysk.TotalFreeSpace 

Get-Wmiobject Win32_logicaldisk -Filter "DeviceID = 'c:'" | Select DeviceID, FreeSpace

# jeden dysk, zdalny

Get-Wmiobject Win32_logicaldisk -Filter "DeviceID = 'c:'" -Computer E02 | Select DeviceID, FreeSpace

# wszystkie dyski
Get-Wmiobject Win32_logicaldisk  | Select DeviceID, FreeSpace

[System.IO.DriveInfo]::GetDrives() | select Name, TotalFreeSpace | ft

# wybrane dyski

([WMISearcher] "Select * from Win32_Logicaldisk where Freespace < 1000000000").Get()  | Select DeviceID, FreeSpace




[System.IO.DriveInfo]::GetDrives() | select TotalFreeSpace


exit
$dysk = new-object System.IO.DriveInfo("C")
"Stara etykieta:"
$dysk.VolumeLabel
"Nowa etykieta:"
$dysk.VolumeLabel = "x"
$dysk.VolumeLabel

Set-VolumeLabel "c:" "systemowy"

$dysk