diff --git a/scripts/DeleteOldProfilesManual.ps1 b/scripts/DeleteOldProfilesManual.ps1 index 57b3603..e69fb49 100644 --- a/scripts/DeleteOldProfilesManual.ps1 +++ b/scripts/DeleteOldProfilesManual.ps1 @@ -76,14 +76,12 @@ ForEach ($computer in $ComputerName) Continue } - If ($PSCmdlet.ShouldProcess($account)) { - Try { - $profile.Delete() - Write-Host "Profile deleted successfully" -ForegroundColor Green - } Catch { - Write-Host "Error during delete the profile" -ForegroundColor Red - } - } + Try { + $profile.Delete() + Write-Host "Profile deleted successfully" -ForegroundColor Green + } Catch { + Write-Host "Error during delete the profile" -ForegroundColor Red + } } }