11 lines
271 B
PowerShell
11 lines
271 B
PowerShell
$folder = "$env:SystemRoot\SoftwareDistribution"
|
|
$sizeBytes = (Get-ChildItem -Path $folder -Recurse -Force | Measure-Object -Property Length -Sum).Sum
|
|
$sizeGB = $sizeBytes / 1GB
|
|
|
|
if ($sizeGB -gt 10) {
|
|
Write-Output 1
|
|
exit 1
|
|
} else {
|
|
Write-Output 0
|
|
exit 0
|
|
} |