diff --git a/scripts/DeleteOldProfiles.ps1 b/scripts/DeleteOldProfiles.ps1 index 80e788d..52bb4ab 100644 --- a/scripts/DeleteOldProfiles.ps1 +++ b/scripts/DeleteOldProfiles.ps1 @@ -97,7 +97,7 @@ ForEach ($computer in $ComputerName) } Try { - $profile.Delete() + Remove-CimInstance $profile Write-Host "Profile deleted successfully" -ForegroundColor Green } Catch { Write-Host "Error during delete the profile" -ForegroundColor Red