3 ms·
For 'du': > Get-ChildItem C:\windows | Measure-Object -property length -sum Count : 28 Average : Sum : 6407920 Maximum : Min
by nailer 11y ago
For 'du':
> Get-ChildItem C:\windows | Measure-Object -property length -sum
Count : 28
Average :
Sum : 6407920
Maximum :
Minimum :
Property : length
For 'df':
> get-WmiObject win32_logicaldisk
DeviceID : C:
DriveType : 3
ProviderName :
FreeSpace : 21796540416
Size : 31685865472
VolumeName :
DeviceID : D:
DriveType : 5
ProviderName :
FreeSpace :
Size :
VolumeName :
DeviceID : Z:
DriveType : 4
ProviderName : \\veertu\share
FreeSpace : 44674220032
Size : 399999991808
VolumeName : VeertuFS
- useerup 11y agoAnd you just built du with a single line of PowerShell. Also, you demonstrated the full syntax. The short form would be (leveraging aliases, positional parameters and unambiguous short parameter names): For du: ls C:\Windows\ | measure length -sum For df: gwmi win32_logicaldisk