Skip to content

Instantly share code, notes, and snippets.

@gioxx
Created January 2, 2019 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gioxx/5aea866ae31099489d1c565be55438ae to your computer and use it in GitHub Desktop.
Save gioxx/5aea866ae31099489d1c565be55438ae to your computer and use it in GitHub Desktop.
Un'integrazione per rilevare lo spazio disco usato e quello libero, da inserire all'interno dello script di pulizia WSUS (vedi articolo: https://gioxx.org/2016/08/09/wsus-clean-ps1/)
Write-Output ""
$drive = Get-PSDrive C
Write-Output "$((get-date).ToLongTimeString()) $server - $($drive.root) Disk Usage..."
$used_size = $drive.used
$free_size = $drive.free
Write-Output "Used space:" ($used_size / 1GB)
Write-Output "Free space:" ($free_size / 1GB)
Write-Output "$((get-date).ToLongTimeString()) $server - $($drive.root) Disk Usage complete."
Write-Output ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment