Additional Script Updates
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# Detection Script: Detect_LowDiskSpace.ps1
|
||||
|
||||
# Define the threshold for low disk space in GB
|
||||
$thresholdGB = 10
|
||||
|
||||
# Get the free space on the system drive
|
||||
$freeSpaceGB = [math]::Round((Get-PSDrive -Name C).Free / 1GB, 2)
|
||||
|
||||
if ($freeSpaceGB -lt $thresholdGB) {
|
||||
Write-Output "Low disk space detected: $freeSpaceGB GB free"
|
||||
exit 1
|
||||
} else {
|
||||
Write-Output "Sufficient disk space: $freeSpaceGB GB free"
|
||||
exit 0
|
||||
}
|
||||
Reference in New Issue
Block a user