Skip to content

Commit 50a9831

Browse files
v1.1.0
1 parent d0d15bf commit 50a9831

25 files changed

+258
-119
lines changed

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11

22
{
33
// When enabled, will trim trailing whitespace when you save a file.
4-
"files.trimTrailingWhitespace": true
4+
"files.trimTrailingWhitespace": true,
5+
"cSpell.words": [
6+
"windowsactivehours",
7+
"windowsupdatesetting"
8+
]
59
}

README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
[![PSGallery Version](https://img.shields.io/powershellgallery/v/WindowsUpdateSetting.png?style=for-the-badge&label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/WindowsUpdateSetting/) [![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/WindowsUpdateSetting.png?style=for-the-badge&label=Downloads)](https://www.powershellgallery.com/packages/WindowsUpdateSetting/)
44

5-
The PowerShell commands in this module are intended to make it easier to automate the process of pausing and resuming Windows Updates on a Windows 10 desktop as well as a few other update-related settings. This module will not work on Windows 10 Home. If you are running Windows 10 Enterprise, your settings may be managed via Group Policy, in which case you won't be able to use this module.
5+
The PowerShell commands in this module are intended to make it easier to automate the process of pausing and resuming Windows Updates on a Windows 10/11 desktop as well as a few other update-related settings. __This module will not work on Windows 10 Home__. If you are running an Enterprise edition of Windows, your settings may be managed via Group Policy, in which case you won't be able to use this module.
66

77
You can install the latest version of this module from the PowerShell Gallery.
88

99
```powershell
10-
Install-Module WindowsUpdateSetting
10+
Install-PSResource WindowsUpdateSetting
1111
```
1212

1313
The module should work on PowerShell 7 running on a Windows platform.
1414

1515
## Command Overview
1616

17-
- [Get-WindowsActiveHours](./docs/Get-WindowsActiveHours.md)
18-
- [Get-WindowsUpdateDeferral](./docs/Get-WindowsUpdateDeferral.md)
19-
- [Get-WindowsUpdateSetting](./docs/Get-WindowsUpdateSetting.md)
20-
- [Resume-WindowsUpdate](./docs/Resume-WindowsUpdate.md)
21-
- [Set-WindowsActiveHours](./docs/Set-WindowsActiveHours.md)
22-
- [Set-WindowsUpdateDeferral](./docs/Set-WindowsUpdateDeferral.md)
23-
- [Suspend-WindowsUpdate](./docs/Suspend-WindowsUpdate.md)
24-
- [Test-IsWindowsUpdatePaused](./docs/Test-IsWindowsUpdatePaused.md)
17+
- [Get-WindowsActiveHours](docs/Get-WindowsActiveHours.md)
18+
- [Get-WindowsUpdateDeferral](docs/Get-WindowsUpdateDeferral.md)
19+
- [Get-WindowsUpdateSetting](docs/Get-WindowsUpdateSetting.md)
20+
- [Resume-WindowsUpdate](docs/Resume-WindowsUpdate.md)
21+
- [Set-WindowsActiveHours](docs/Set-WindowsActiveHours.md)
22+
- [Set-WindowsUpdateDeferral](docs/Set-WindowsUpdateDeferral.md)
23+
- [Suspend-WindowsUpdate](docs/Suspend-WindowsUpdate.md)
24+
- [Test-IsWindowsUpdatePaused](docs/Test-IsWindowsUpdatePaused.md)
2525

2626
## Suspend and Resume Windows Updates
2727

@@ -38,11 +38,17 @@ PS C:\> Suspend-WindowsUpdate -passthru
3838
3939
Paused PauseStartUTC PauseEndUTC TimeRemaining
4040
------ ------------- ----------- -------------
41-
True 8/9/2023 8:27:34 PM 9/13/2023 8:27:34 PM 35.03:59:59
41+
True 3/18/2025 12:32:04 PM 4/22/2025 12:32:04 PM 35.03:59:59
4242
```
4343

4444
Or you can specify a date, as long as it is less than 35 days. Use `Get-WindowsUpdateSetting` to view the current values or `Test-IsWindowsUpdatePaused` to test.
4545

46+
Updates should resume automatically at the end of the pause period. However, you can run `Resume-WindowsUpdate` to resume updates manually.
47+
48+
```powershell
49+
Resume-WindowsUpdate
50+
```
51+
4652
## Configure Active Hours
4753

4854
This module also contains commands to set your active hours.
@@ -54,7 +60,7 @@ PS C:\> Get-WindowsActiveHours
5460
5561
Computername Start End
5662
------------ ----- ---
57-
PROSPERO 06:00 AM 10:00 PM
63+
PROSPERO 06:00 AM 11:00 PM
5864
5965
6066
PS C:\> Set-WindowsActiveHours -StartTime 8:00 -EndTime 20:00 -Passthru
@@ -77,14 +83,18 @@ PS C:\> Get-WindowsUpdateDeferral
7783
7884
Computername FeatureUpdateDeferral QualityUpdateDeferral
7985
------------ --------------------- ---------------------
80-
BOVINE320 30 7
86+
PROSPERO undefined undefined
87+
```
8188

89+
Use `Set-WindowsUpdateDeferral` to set the deferral values. You can use `-Feature` and `-Quality` to set the number of days to defer feature and quality updates, respectively.
8290

83-
PS C:\> Set-WindowsUpdateDeferral -Feature 0 -Quality 0 -Passthru
91+
```powershell
92+
PS C:\> Set-WindowsUpdateDeferral -Feature 30 -Quality 7 -Passthru
8493
8594
Computername FeatureUpdateDeferral QualityUpdateDeferral
8695
------------ --------------------- ---------------------
87-
BOVINE320 30 7
96+
PROSPERO 30 7
8897
```
8998

9099
**You should test all of these commands on a non-production system.**
100+

WindowsUpdateSetting.psd1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
@{
66
RootModule = 'WindowsUpdateSetting.psm1'
7-
ModuleVersion = '1.0.0'
7+
ModuleVersion = '1.1.0'
88
CompatiblePSEditions = @('Desktop', 'Core')
99
GUID = '1d09501c-fc3f-424a-9fb9-c2a5d6f59001'
1010
Author = 'Jeff Hicks'
1111
CompanyName = 'JDH Information Technology Solutions, Inc.'
12-
Copyright = '(c) 2018-2023 Jeff Hicks. All rights reserved.'
12+
Copyright = '(c) 2018-2025 Jeff Hicks. All rights reserved.'
1313
Description = 'A set of PowerShell functions to managing Windows Update settings such as pausing, on Windows 10 or Windows 11. This module should work in Windows PowerShell and PowerShell 7 on a Windows platform.'
1414
PowerShellVersion = '5.1'
1515
FunctionsToExport = @(
@@ -22,7 +22,10 @@
2222
'Get-WindowsUpdateDeferral',
2323
'Set-WindowsUpdateDeferral'
2424
)
25-
FormatsToProcess = @('formats\windowsactivehours.format.ps1xml','formats\windowsupdatesetting.format.ps1xml')
25+
FormatsToProcess = @(
26+
'formats\windowsactivehours.format.ps1xml',
27+
'formats\windowsupdatesetting.format.ps1xml'
28+
)
2629
CmdletsToExport = ''
2730
AliasesToExport = 'rwu', 'swu', 'gwu'
2831
PrivateData = @{

WindowsUpdateSetting.psm1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1-
if ($ISWindows -or $PSEdition -eq 'Desktop') {
1+
Import-LocalizedData -BindingVariable strings
2+
if ($ISWindows -Or $PSEdition -eq 'Desktop') {
23
Get-ChildItem -path $PSScriptRoot\functions\*.ps1 |
34
ForEach-Object {
45
. $_.FullName
56
}
7+
8+
#define a module-scoped variable for the module version
9+
$ModuleVersion = (Test-ModuleManifest -Path $PSScriptRoot\WindowsUpdateSetting.psd1).Version
10+
11+
#a module-scoped variable for the ANSI escape sequences using in custom verbose messaging
12+
$VerboseAnsi = @{
13+
"Default" = "[93m"
14+
}
615
}
716
else {
817
#get the module name
918
$ModuleName = $MyInvocation.MyCommand.Name.split(".")[0]
10-
Write-Warning "The $ModuleName module requires a Windows platform."
19+
Write-Warning ($strings.RequiresWindows -f $ModuleName)
1120
}

changelog.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# Changelog for WindowsUpdateSetting
22

3-
## v1.0.0
3+
## [Unreleased]
4+
5+
## [1.1.0] - 2025-03-18
6+
7+
### Added
8+
9+
- Added custom verbose messaging using localized string data.
10+
11+
### Changed
12+
13+
- Changed online help links.
14+
- Converted `Changelog` to new format.
15+
- Updated `README`.
16+
17+
## [v1.0.0] - 2023-08-09
418

519
### Changed
620

@@ -14,40 +28,47 @@
1428

1529
- Added custom format files `windowsupdatesetting.format.ps1xml` and windowsactivehours.format.ps1xml`.
1630
- Added missing online help links.
17-
-
18-
## v0.3.2
31+
32+
## [v0.3.2] - 2018-10-23
1933

2034
- file cleanup for PowerShell Gallery
2135
- manifest update
2236

23-
## v0.3.1
37+
## [v0.3.1] - 2018-09-24
2438

2539
- Updated manifest
2640
- Updated help for `Suspend-WindowsUpdate` ([Issue #4](https://github.com/jdhitsolutions/WindowsUpdateSetting/issues/4))
2741
- Added module icon
2842
- Updated README
2943
- Added some command aliases
3044

31-
## v0.3.0
45+
## [v0.3.0] - 2018-09-20
3246

3347
- Updated ShouldProcess message on `Suspend-WindowsUpdate` ([Issue #3](https://github.com/jdhitsolutions/WindowsUpdateSetting/issues/3))
3448
- Added custom type names to PSCustomObject output ([Issue #2](https://github.com/jdhitsolutions/WindowsUpdateSetting/issues/2))
3549
- Updated README
3650
- Updated documentation
3751

38-
## v0.2.1
52+
## v0.2.1 - 2018-09-20
3953

4054
- Github updates
4155
- Updated README
4256

43-
## v0.2.0
57+
## v0.2.0 - 2018-09-20
4458

4559
- Updated manifest
4660
- Added functions to defer feature and quality updates
4761
- Added function set manage Windows Active hours
4862
- Modified `Suspend-WindowsUpdate` to specify a resume date.
4963
- Updated documentation
5064

51-
## v0.1.0
65+
## v0.1.0 - 2018-09-19
5266

5367
- initial files
68+
69+
[Unreleased]: https://github.com/jdhitsolutions/WindowsUpdateSetting/compare/v1.1.0..HEAD
70+
[v1.1.0]: https://github.com/jdhitsolutions/WindowsUpdateSetting/compare/1.0.0..v1.1.0
71+
[v1.0.0]: https://github.com/jdhitsolutions/WindowsUpdateSetting/compare/v0.3.2..v1.0.0
72+
[v0.3.2]: https://github.com/jdhitsolutions/WindowsUpdateSetting/compare/0.3.1..v0.3.2
73+
[v0.3.1]: https://github.com/jdhitsolutions/WindowsUpdateSetting/compare/0.3.0..0.3.1
74+
[v0.3.0]: https://github.com/jdhitsolutions/WindowsUpdateSetting/compare/0.2.1..0.3.0

docs/Get-WindowsActiveHours.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: WindowsUpdateSetting-help.xml
33
Module Name: WindowsUpdateSetting
4-
online version: https://bit.ly/47nMfSG
4+
online version: https://jdhitsolutions.com/yourls/2a97cc
55
schema: 2.0.0
66
---
77

@@ -49,7 +49,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
4949

5050
## NOTES
5151

52-
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/
52+
Learn more about PowerShell: https://buttondown.com/behind-the-powershell-pipeline
5353

5454
## RELATED LINKS
5555

docs/Get-WindowsUpdateDeferral.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: WindowsUpdateSetting-help.xml
33
Module Name: WindowsUpdateSetting
4-
online version: https://bit.ly/440sPk0
4+
online version: https://jdhitsolutions.com/yourls/355b5b
55
schema: 2.0.0
66
---
77

@@ -49,7 +49,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
4949

5050
## NOTES
5151

52-
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/
52+
Learn more about PowerShell: https://buttondown.com/behind-the-powershell-pipeline
5353

5454
## RELATED LINKS
5555

docs/Get-WindowsUpdateSetting.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: WindowsUpdateSetting-help.xml
33
Module Name: WindowsUpdateSetting
4-
online version: https://bit.ly/3s6oApN
4+
online version: https://jdhitsolutions.com/yourls/c7d249
55
schema: 2.0.0
66
---
77

@@ -28,11 +28,11 @@ Display the current values for any paused Windows Update settings.
2828
```powershell
2929
PS C:\> Get-WindowsUpdateSetting
3030
31-
Computername : BOVINE320
32-
UpdatesPaused : True
33-
PauseStartUTC : 9/19/2022 11:13:16 PM
34-
PauseEndUTC : 10/24/2022 11:13:16 PM
35-
Remaining : 34.23:55:49.1598117
31+
Computername: PROSPERO
32+
33+
Paused PauseStartUTC PauseEndUTC TimeRemaining
34+
------ ------------- ----------- -------------
35+
True 3/18/2025 1:42:20 PM 4/22/2025 1:42:20 PM 35.03:59:55
3636
```
3737

3838
The settings when updates are paused.
@@ -53,7 +53,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
5353

5454
## NOTES
5555

56-
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/
56+
Learn more about PowerShell: https://buttondown.com/behind-the-powershell-pipeline
5757

5858
## RELATED LINKS
5959

docs/Resume-WindowsUpdate.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: WindowsUpdateSetting-help.xml
33
Module Name: WindowsUpdateSetting
4-
online version: https://bit.ly/3DP7hfp
4+
online version: https://jdhitsolutions.com/yourls/133e47
55
schema: 2.0.0
66
---
77

@@ -95,8 +95,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
9595
9696
## NOTES
9797
98-
Learn more about PowerShell:
99-
http://jdhitsolutions.com/blog/essential-powershell-resources/
98+
Learn more about PowerShell: https://buttondown.com/behind-the-powershell-pipeline
10099
101100
## RELATED LINKS
102101

docs/Set-WindowsActiveHours.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: WindowsUpdateSetting-help.xml
33
Module Name: WindowsUpdateSetting
4-
online version: https://bit.ly/3DRauLo
4+
online version: https://jdhitsolutions.com/yourls/4ada3f
55
schema: 2.0.0
66
---
77

@@ -137,7 +137,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
137137
138138
## NOTES
139139
140-
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/
140+
Learn more about PowerShell: https://buttondown.com/behind-the-powershell-pipeline
141141
142142
## RELATED LINKS
143143

docs/Set-WindowsUpdateDeferral.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: WindowsUpdateSetting-help.xml
33
Module Name: WindowsUpdateSetting
4-
online version: https://bit.ly/44ZqRS1
4+
online version: https://jdhitsolutions.com/yourls/33f459
55
schema: 2.0.0
66
---
77

@@ -134,7 +134,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
134134
135135
## NOTES
136136
137-
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/
137+
Learn more about PowerShell: https://buttondown.com/behind-the-powershell-pipeline
138138
139139
## RELATED LINKS
140140

docs/Suspend-WindowsUpdate.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: WindowsUpdateSetting-help.xml
33
Module Name: WindowsUpdateSetting
4-
online version: https://bit.ly/3DQf7Wb
4+
online version: https://jdhitsolutions.com/yourls/22231b
55
schema: 2.0.0
66
---
77

@@ -19,8 +19,7 @@ Suspend-WindowsUpdate [-Resume <DateTime>] [-Passthru] [-WhatIf] [-Confirm] [<Co
1919

2020
## DESCRIPTION
2121

22-
This command achieves the same result as pausing Windows Updates in Settings/Windows Update/Advanced Settings.
23-
By default your system will not check or get any updates for 35 days. But you can specify a date that is less than 35 days.
22+
This command achieves the same result as pausing Windows Updates in Settings/Windows Update/Advanced Settings. By default your system will not check or get any updates for 35 days. But you can specify a date that is less than 35 days.
2423

2524
## EXAMPLES
2625

@@ -39,7 +38,7 @@ PS C:\> Suspend-WindowsUpdate -passthru
3938
4039
Paused PauseStartUTC PauseEndUTC TimeRemaining
4140
------ ------------- ----------- -------------
42-
True 8/9/2023 8:27:34 PM 9/13/2023 8:27:34 PM 35.03:59:59
41+
True 3/18/2025 1:42:20 PM 4/22/2025 1:42:20 PM 35.03:59:59
4342
```
4443

4544
### EXAMPLE 3
@@ -130,8 +129,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
130129
131130
## NOTES
132131
133-
Learn more about PowerShell:
134-
http://jdhitsolutions.com/blog/essential-powershell-resources/
132+
Learn more about PowerShell: https://buttondown.com/behind-the-powershell-pipeline
135133
136134
## RELATED LINKS
137135

0 commit comments

Comments
 (0)