Files
GPOZaurr/Public/Remove-GPOZaurrOrphanedSysvolFolders.ps1
T
2020-05-26 19:03:21 +02:00

13 lines
416 B
PowerShell

function Remove-GPOZaurrOrphanedSysvolFolders {
[cmdletBinding(SupportsShouldProcess)]
param(
[int] $LimitProcessing = [int32]::MaxValue
)
Get-GPOZaurrSysvol | Where-Object {
if ($_.Status -eq 'Orphaned GPO') {
$_
}
} | Select-Object | Select-Object -First $LimitProcessing | ForEach-Object {
Remove-Item -Recurse -Force -LiteralPath $_.Path
}
}