mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2026-01-11 02:04:44 +01:00
cleanup reg install location when reverting custom package
This commit is contained in:
@@ -712,6 +712,14 @@ function Install-NOAIPackage {
|
|||||||
catch {
|
catch {
|
||||||
dism.exe /Online /remove-package /PackageName:$($package.PackageName) /NoRestart
|
dism.exe /Online /remove-package /PackageName:$($package.PackageName) /NoRestart
|
||||||
}
|
}
|
||||||
|
#remove reg install location
|
||||||
|
$regPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages'
|
||||||
|
Get-ChildItem $regPath | ForEach-Object {
|
||||||
|
$value = try { Get-ItemProperty "registry::$($_.Name)" -ErrorAction Stop } catch { $null }
|
||||||
|
if ($value -and $value.PSPath -like '*zoicware*') {
|
||||||
|
Remove-Item -Path $value.PSPath -Recurse -Force
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user