mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2026-01-11 10:14:44 +01:00
minor fixes
This commit is contained in:
@@ -832,6 +832,8 @@ Windows Registry Editor Version 5.00
|
|||||||
|
|
||||||
function Install-NOAIPackage {
|
function Install-NOAIPackage {
|
||||||
if (!$revert) {
|
if (!$revert) {
|
||||||
|
$package = Get-WindowsPackage -Online | Where-Object { $_.PackageName -like '*zoicware*' }
|
||||||
|
if (!$package) {
|
||||||
#check cpu arch
|
#check cpu arch
|
||||||
$arm = ((Get-CimInstance -Class Win32_ComputerSystem).SystemType -match 'ARM64') -or ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64')
|
$arm = ((Get-CimInstance -Class Win32_ComputerSystem).SystemType -match 'ARM64') -or ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64')
|
||||||
$arch = if ($arm) { 'arm64' } else { 'amd64' }
|
$arch = if ($arm) { 'arm64' } else { 'amd64' }
|
||||||
@@ -847,11 +849,11 @@ function Install-NOAIPackage {
|
|||||||
|
|
||||||
Write-Status -msg 'Installing RemoveWindowsAI Package...'
|
Write-Status -msg 'Installing RemoveWindowsAI Package...'
|
||||||
try {
|
try {
|
||||||
Add-WindowsPackage -Online -PackagePath "$PSScriptRoot\RemoveWindowsAIPackage\$arch\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" -NoRestart -IgnoreCheck -ErrorAction Stop
|
Add-WindowsPackage -Online -PackagePath "$PSScriptRoot\RemoveWindowsAIPackage\$arch\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" -NoRestart -IgnoreCheck -ErrorAction Stop >$null
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
#user is using powershell 7 use dism command as fallback
|
#user is using powershell 7 use dism command as fallback
|
||||||
dism.exe /Online /Add-Package /PackagePath:"$PSScriptRoot\RemoveWindowsAIPackage\$arch\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" /NoRestart /IgnoreCheck
|
dism.exe /Online /Add-Package /PackagePath:"$PSScriptRoot\RemoveWindowsAIPackage\$arch\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" /NoRestart /IgnoreCheck >$null
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -868,13 +870,18 @@ function Install-NOAIPackage {
|
|||||||
|
|
||||||
Write-Status -msg 'Installing RemoveWindowsAI Package...'
|
Write-Status -msg 'Installing RemoveWindowsAI Package...'
|
||||||
try {
|
try {
|
||||||
Add-WindowsPackage -Online -PackagePath "$env:TEMP\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" -NoRestart -IgnoreCheck -ErrorAction Stop
|
Add-WindowsPackage -Online -PackagePath "$env:TEMP\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" -NoRestart -IgnoreCheck -ErrorAction Stop >$null
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
dism.exe /Online /Add-Package /PackagePath:"$env:TEMP\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" /NoRestart /IgnoreCheck
|
dism.exe /Online /Add-Package /PackagePath:"$env:TEMP\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" /NoRestart /IgnoreCheck >$null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Write-Status -msg 'Update package already installed... Skipping'
|
||||||
|
#Write-Host $($package | Select-Object *)
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$package = Get-WindowsPackage -Online | Where-Object { $_.PackageName -like '*zoicware*' }
|
$package = Get-WindowsPackage -Online | Where-Object { $_.PackageName -like '*zoicware*' }
|
||||||
@@ -1508,7 +1515,7 @@ function Remove-AI-CBS-Packages {
|
|||||||
if ($value -ne $null) {
|
if ($value -ne $null) {
|
||||||
if ($value -eq 2 -and $_.PSChildName -like '*AIX*' -or $_.PSChildName -like '*Recall*' -or $_.PSChildName -like '*Copilot*' -or $_.PSChildName -like '*CoreAI*') {
|
if ($value -eq 2 -and $_.PSChildName -like '*AIX*' -or $_.PSChildName -like '*Recall*' -or $_.PSChildName -like '*Copilot*' -or $_.PSChildName -like '*CoreAI*') {
|
||||||
Set-ItemProperty "registry::$($_.Name)" -Name Visibility -Value 1 -Force
|
Set-ItemProperty "registry::$($_.Name)" -Name Visibility -Value 1 -Force
|
||||||
New-ItemProperty "registry::$($_.Name)" -Name DefVis -PropertyType DWord -Value 2 -Force
|
New-ItemProperty "registry::$($_.Name)" -Name DefVis -PropertyType DWord -Value 2 -Force | Out-Null
|
||||||
Remove-Item "registry::$($_.Name)\Owners" -Force -ErrorAction SilentlyContinue
|
Remove-Item "registry::$($_.Name)\Owners" -Force -ErrorAction SilentlyContinue
|
||||||
Remove-Item "registry::$($_.Name)\Updates" -Force -ErrorAction SilentlyContinue
|
Remove-Item "registry::$($_.Name)\Updates" -Force -ErrorAction SilentlyContinue
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user