Remove provisioned package before uninstall it for users
This commit is contained in:
parent
5536ab63b3
commit
62e6d18efd
1 changed files with 3 additions and 3 deletions
|
@ -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 {
|
||||||
|
|
Reference in a new issue