From 0a442e601e10cc7e67d789fb92f8d61b5060559d Mon Sep 17 00:00:00 2001 From: Saqib <70284132+saqib-s@users.noreply.github.com> Date: Thu, 9 Mar 2023 20:14:53 -0500 Subject: [PATCH] Update WindowsCleanup.ps1 Add -AllUsers to the remove command as it throws an error without this. --- WindowsCleanup.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WindowsCleanup.ps1 b/WindowsCleanup.ps1 index 286b0ec..43577a3 100644 --- a/WindowsCleanup.ps1 +++ b/WindowsCleanup.ps1 @@ -101,7 +101,7 @@ $builtinappstoremove = @( foreach ($app in $builtinappstoremove) { Write-Log "Attempting to remove $app" - Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage + Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers Get-AppXProvisionedPackage -Online | Where {$_.DisplayName -eq "$app"} | Remove-AppxProvisionedPackage -Online Write-Log "Removed $app" Write-Log $SubBreakingLine