Skip to content

Instantly share code, notes, and snippets.

@ZSendokame
Created April 9, 2024 20:56
Show Gist options
  • Save ZSendokame/e2cb35e94d7352802b6f4243fbc1a2a3 to your computer and use it in GitHub Desktop.
Save ZSendokame/e2cb35e94d7352802b6f4243fbc1a2a3 to your computer and use it in GitHub Desktop.
Get how many gigabytes there is in a directory.
function space(){
param($Directory)
$total = 0
foreach($file in Get-ChildItem $Directory){
$total += $file.length
}
return $total / 1Gb
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment