mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2026-01-10 17:54:50 +01:00
cleanup reg install location when reverting custom package
This commit is contained in:
@@ -712,6 +712,14 @@ function Install-NOAIPackage {
|
||||
catch {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user