mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 11:06:18 +00:00
Refactored new communication apps removal option
This commit is contained in:
@@ -85,6 +85,27 @@ function RemoveApps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Removes apps specified during function call from all user accounts and from the OS image.
|
||||||
|
function RemoveSpecificApps {
|
||||||
|
param
|
||||||
|
(
|
||||||
|
$appslist
|
||||||
|
)
|
||||||
|
|
||||||
|
Foreach ($app in $appsList)
|
||||||
|
{
|
||||||
|
$appString = $app.Trim('*')
|
||||||
|
Write-Output "Attempting to remove $appString..."
|
||||||
|
|
||||||
|
# Remove installed app for all existing users
|
||||||
|
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
|
||||||
|
|
||||||
|
# Remove provisioned app from OS image, so the app won't be installed for any new users
|
||||||
|
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Import & execute regfile
|
# Import & execute regfile
|
||||||
function RegImport {
|
function RegImport {
|
||||||
param
|
param
|
||||||
@@ -510,38 +531,18 @@ else {
|
|||||||
}
|
}
|
||||||
'RemoveCommApps' {
|
'RemoveCommApps' {
|
||||||
Write-Output "> Removing Mail, Calendar and People apps..."
|
Write-Output "> Removing Mail, Calendar and People apps..."
|
||||||
|
|
||||||
$appsList = '*Microsoft.windowscommunicationsapps*', '*Microsoft.People*'
|
$appsList = '*Microsoft.windowscommunicationsapps*', '*Microsoft.People*'
|
||||||
|
RemoveSpecificApps $appsList
|
||||||
Foreach ($app in $appsList)
|
|
||||||
{
|
|
||||||
$appString = $app.Trim('*')
|
|
||||||
Write-Output "Attempting to remove $appString..."
|
|
||||||
|
|
||||||
# Remove installed app for all existing users
|
|
||||||
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
|
|
||||||
|
|
||||||
# Remove provisioned app from OS image, so the app won't be installed for any new users
|
|
||||||
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'RemoveW11Outlook' {
|
'RemoveW11Outlook' {
|
||||||
Write-Output "> Removing new Outlook for Windows app..."
|
Write-Output "> Removing new Outlook for Windows app..."
|
||||||
|
|
||||||
$appsList = '*Microsoft.OutlookForWindows*'
|
$appsList = '*Microsoft.OutlookForWindows*'
|
||||||
|
RemoveSpecificApps $appsList
|
||||||
Foreach ($app in $appsList)
|
|
||||||
{
|
|
||||||
$appString = $app.Trim('*')
|
|
||||||
Write-Output "Attempting to remove $appString..."
|
|
||||||
|
|
||||||
# Remove installed app for all existing users
|
|
||||||
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
|
|
||||||
|
|
||||||
# Remove provisioned app from OS image, so the app won't be installed for any new users
|
|
||||||
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user