Get-PSDrive

noun

say it: “GET PEE-ESS DRYV” /ˈɡɛt ˌpiˌɛs ˈdraɪv/

A PowerShell command that gets a drive, such as C, with how much space on it is used and how much is free.

What does Get-PSDrive do?

Get-PSDrive gets a drive as an object. Its Used and Free properties are the space in bytes, a number too long to read, so divide by 1GB, PowerShell's word for one gigabyte. On a Mac or Linux, the drive is called /.

(Get-PSDrive -Name C).Free / 1GB
# 805.812465667725

In a sentence

  • “Get-PSDrive showed 805.8 GB free once the bytes were divided by 1GB.”
  • “Sam's morning script uses Get-PSDrive to warn him before drive C fills up.”

Level: Apprentice · More PowerShell terms at this level

Updated