Remove Additional Installers

This commit is contained in:
zoicware
2024-11-17 22:15:47 -05:00
committed by GitHub
parent 41d00a2417
commit 8c970d9160

View File

@@ -149,6 +149,17 @@ foreach ($folder in $folders) {
if ($fullPath -ne $null) { Remove-Item -Path $fullPath -Recurse -Force -ErrorAction SilentlyContinue } if ($fullPath -ne $null) { Remove-Item -Path $fullPath -Recurse -Force -ErrorAction SilentlyContinue }
} }
#remove additional installers
$inboxapps = 'C:\Windows\InboxApps'
$installers = Get-ChildItem -Path $inboxapps -Filter '*Copilot*'
foreach ($installer in $installers) {
takeown /f $installer.FullName *>$null
icacls $installer.FullName /grant administrators:F /t *>$null
Remove-Item -Path $installer.FullName -Force
}
#remove any screenshots from recall #remove any screenshots from recall
Write-Host 'Removing Any Screenshots...' Write-Host 'Removing Any Screenshots...'
Remove-Item -Path "$env:LOCALAPPDATA\CoreAIPlatform*" -Force -Recurse -ErrorAction SilentlyContinue Remove-Item -Path "$env:LOCALAPPDATA\CoreAIPlatform*" -Force -Recurse -ErrorAction SilentlyContinue