→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎03-11-2021 08:20 PM
‎03-25-2021 07:43 AM
‎03-23-2021 09:32 PM
‎03-12-2021 06:01 PM
‎03-12-2021 04:37 PM
‎03-12-2021 10:48 AM
$Computername=$args[0]
$startDirectory = "\\" + $Computername + "\c$"
$directoryItems = Get-ChildItem $startDirectory | Where-Object {$_.PSIsContainer -eq $true} | Sort-Object
foreach ($i in $directoryItems)
{
$subFolderItems = Get-ChildItem $i.FullName -recurse -force | Where-Object {$_.PSIsContainer -eq $false} | Measure-Object -property Length -sum | Select-Object Sum
$i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1GB) + " GB"
}
powershell -noprofile -ExecutionPolicy bypass -command //LansweeperServerName/defaultpackageshare$/scripts/script.ps1 {computer}
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now