Skip to content

Commit 42d1d1c

Browse files
committed
Update Disable-WindowsUpdate
minor adjustments and bump
1 parent edf0302 commit 42d1d1c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ps-win-updates/Disable-WindowsUpdate.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ Function Disable-WindowsUpdate {
99
.PARAMETER UpdateOperation
1010
NotMandatory - update operation to perform, the available options are '/D', '/E', and '/D /P' (default). '/D' disables updates, '/E' enables updates, and '/D /P' disables updates permanently. Default is '/D /P'.
1111
.PARAMETER WudUrl
12-
NotMandatory - specifies the URL of the Windows Update Disabler tool to download. Default is "https://www.sordum.org/files/downloads.php?st-windows-update-blocker".
12+
NotMandatory - specifies the URL of the Windows Update Disabler tool to download.
1313
.PARAMETER RemoveWUB
1414
NotMandatory - whether to remove Windows Update Disable tool after disabling Windows Updates.
1515
.PARAMETER Restart
1616
NotMandatory - indicates whether to restart the computer after applying the update operation.
1717
1818
.EXAMPLE
19-
Disable-WindowsUpdate
19+
Disable-WindowsUpdate -Verbose
2020
Disable-WindowsUpdate -UpdateOperation /E -Restart
2121
2222
.NOTES
23-
v0.0.1
23+
v0.0.2
2424
#>
2525
[CmdletBinding()]
2626
param(
@@ -40,7 +40,7 @@ Function Disable-WindowsUpdate {
4040
try {
4141
New-Item -Path "$env:TEMP" -Name "WU_Disable" -ItemType Directory -Force | Out-Null
4242
if (!(Test-Path -Path "$env:TEMP\WU_Disable\Wub_v1.8.zip")) {
43-
Write-Host "Downloading Windows Update disabler..."
43+
Write-Host "Downloading Windows Update disabler..." -ForegroundColor Green
4444
Invoke-WebRequest -Uri $WudUrl -OutFile "$env:TEMP\WU_Disable\Wub_v1.8.zip" -UseBasicParsing -Verbose
4545
}
4646
Expand-Archive -Path "$env:TEMP\WU_Disable\Wub_v1.8.zip" -DestinationPath "$env:TEMP\WU_Disable" -Force -Verbose
@@ -49,7 +49,7 @@ Function Disable-WindowsUpdate {
4949
Start-Process cmd -ArgumentList "/c $env:TEMP\WU_Disable\Wub\Wub_x64.exe $UpdateOperation" -WindowStyle Minimized -Wait
5050
}
5151
catch {
52-
Write-Error "An error occurred: $_"
52+
Write-Error -Message "An error occurred: $_"
5353
}
5454
finally {
5555
if (("wuauserv", "WaaSMedicSvc" | Get-Service).Status -eq "Stopped") {

0 commit comments

Comments
 (0)