Hey All
yeah, 100th post
Quick one but a good one. This essentially a one liner to get the available GB in a drive share.
$ComputerShare = "<\\Server\ShareName>"
(new-object -com scripting.fileSystemObject).getdrive($ComputerShare).availablespace / 1GB
There is many other attributes you could pull instead of just available space although the highlighted are most useful of the entries.
[system.Math]::Round((new-object -com scripting.fileSystemObject).getdrive($ComputerShare).availablespace / 1GB, 0)
I hope you enjoy
C
yeah, 100th post
Quick one but a good one. This essentially a one liner to get the available GB in a drive share.
$ComputerShare = "<\\Server\ShareName>"
(new-object -com scripting.fileSystemObject).getdrive($ComputerShare).availablespace / 1GB
There is many other attributes you could pull instead of just available space although the highlighted are most useful of the entries.
- Path
- DriveLetter
- ShareName
- DriveType
- RootFolder
- AvailableSpace
- FreeSpace
- TotalSize
- VolumeName
- FileSystem
- SerialNumber
- IsReady
[system.Math]::Round((new-object -com scripting.fileSystemObject).getdrive($ComputerShare).availablespace / 1GB, 0)
I hope you enjoy
C
Comments