mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-09-05 18:55:48 -05:00
remove admin checks for updates
This commit is contained in:
@ -6,12 +6,6 @@ function Invoke-WPFUpdatesdefault {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
# Check if running as administrator
|
|
||||||
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
|
||||||
Write-Host "This function requires administrator privileges. Please run as administrator." -ForegroundColor Red
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Restoring Windows Update registry settings..." -ForegroundColor Yellow
|
Write-Host "Restoring Windows Update registry settings..." -ForegroundColor Yellow
|
||||||
|
|
||||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
||||||
|
@ -10,13 +10,6 @@ function Invoke-WPFUpdatesdisable {
|
|||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
# Check if running as administrator
|
|
||||||
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
|
||||||
Write-Host "This function requires administrator privileges. Please run as administrator." -ForegroundColor Red
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Registry modifications
|
|
||||||
Write-Host "Configuring registry settings..." -ForegroundColor Yellow
|
Write-Host "Configuring registry settings..." -ForegroundColor Yellow
|
||||||
|
|
||||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
|
||||||
|
Reference in New Issue
Block a user