From 1159cd4a7453becdf13f24d113ed3a259a3a1da7 Mon Sep 17 00:00:00 2001 From: poslop Date: Thu, 13 Feb 2025 11:16:47 -0600 Subject: [PATCH] testing new script --- scripts/DeleteOldProfilesManual.ps1 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 + } } }