Remove provisioned package before uninstall it for users

This commit is contained in:
Yorick Barbanneau 2018-04-11 21:17:01 +02:00
parent 5536ab63b3
commit 62e6d18efd

View file

@ -391,6 +391,9 @@ function UninstallModernApp {
)] )]
[object]$params [object]$params
) )
if ( $params.ContainsKey('removeProvisioned') -and $params.removeProvisioned -eq $true ) {
UninstallModernProvisionedApp $params
}
if ( $params.ContainsKey('file') ) { if ( $params.ContainsKey('file') ) {
$pkgs = $(Get-AppxPackage -AllUsers).name $pkgs = $(Get-AppxPackage -AllUsers).name
$uninstall_list = Get-Content $params.file | Where { $_ -notmatch "^#.*$|^$" } $uninstall_list = Get-Content $params.file | Where { $_ -notmatch "^#.*$|^$" }
@ -416,9 +419,6 @@ function UninstallModernApp {
Write-Host -ForegroundColor Red "`tError : No name or file for action $($MyInvocation.MyCommand.Name)" Write-Host -ForegroundColor Red "`tError : No name or file for action $($MyInvocation.MyCommand.Name)"
return return
} }
if ( $params.ContainsKey('removeProvisioned') -and $params.removeProvisioned -eq $true ) {
UninstallModernProvisionedApp $params
}
} }
function UninstallModernProvisionedApp { function UninstallModernProvisionedApp {