Skip to content

Commit 1791d2e

Browse files
committed
BREAKING CHANGE: xWindowsUpdate: Added automatic release with a new CI pipeline (#94)
- xWindowsUpdate - BREAKING CHANGE: Removed the deprecated resource `xMicrosoftUpdate`- - Added automatic release with a new CI pipeline. - Moved the `Set-StrictMode` so that it is used during testing only and not during runtime. - Removed the helper function `Trace-Message` and using the `Write-Verbose` directly instead. - The helper function `New-InvalidArgumentException` was replaced by its equivalent in the module DscResource.Common. xWindowsUpdateAgent - Added Retry logic to known transient errors (issue #24). - Removed the `$PSCmdlet.ShouldProcess` calls from code since DSC does not support interactive actions. - No longer defaults to output verbose messages.
1 parent 3bda7ad commit 1791d2e

File tree

55 files changed

+4392
-2945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4392
-2945
lines changed

.MetaTestOptIn.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
# Needed for publishing of examples, build worker defaults to core.autocrlf=input.
22
* text eol=crlf
3+
4+
# Ensure any exe files are treated as binary
5+
*.exe binary
6+
*.jpg binary
7+
*.xl* binary
8+
*.pfx binary

.github/ISSUE_TEMPLATE/Problem_with_resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ about: If you have a problem, bug, or enhancement with a resource in this resour
5454
$PSVersionTable
5555
-->
5656

57-
#### Version of the DSC module that was used ('dev' if using current dev branch)
57+
#### Version of the DSC module that was used

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@
1414
#### Pull Request (PR) description
1515
<!--
1616
Replace this comment block with a description of your PR.
17+
Also, make sure you have updated the CHANGELOG.md, see the
18+
task list below. An entry in the CHANGELOG.md is mandatory
19+
for all PRs.
1720
-->
1821

1922
#### This Pull Request (PR) fixes the following issues
2023
<!--
2124
If this PR does not fix an open issue, replace this comment block with None.
2225
If this PR resolves one or more open issues, replace this comment block with
23-
a list the issues using a GitHub closing keyword, e.g.:
24-
- Fixes #123
25-
- Fixes #124
26+
a list of the issues using a GitHub closing keyword, e.g.:
27+
28+
- Fixes #123
29+
- Fixes #124
2630
-->
2731

2832
#### Task list
@@ -34,14 +38,16 @@
3438
Change to [x] for each task in the task list that applies to your PR.
3539
For those task that don't apply to you PR, leave those as is.
3640
-->
37-
- [ ] Added an entry under the Unreleased section of the change log in the README.md.
38-
Entry should say what was changed, and how that affects users (if applicable).
41+
- [ ] Added an entry to the change log under the Unreleased section of the
42+
file CHANGELOG.md. Entry should say what was changed and how that
43+
affects users (if applicable), and reference the issue being resolved
44+
(if applicable).
3945
- [ ] Resource documentation added/updated in README.md.
4046
- [ ] Resource parameter descriptions added/updated in README.md, schema.mof
4147
and comment-based help.
4248
- [ ] Comment-based help added/updated.
4349
- [ ] Localization strings added/updated in all localization files as appropriate.
4450
- [ ] Examples appropriately added/updated.
45-
- [ ] Unit tests added/updated. See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
46-
- [ ] Integration tests added/updated (where possible). See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
47-
- [ ] New/changed code adheres to [DSC Resource Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md) and [Best Practices](https://github.com/PowerShell/DscResources/blob/master/BestPractices.md).
51+
- [ ] Unit tests added/updated. See [DSC Community Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines).
52+
- [ ] Integration tests added/updated (where possible). See [DSC Community Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines).
53+
- [ ] New/changed code adheres to [DSC Community Style Guidelines](https://dsccommunity.org/styleguidelines).

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
DSCResource.Tests
1+
output/
2+
.vs
3+
.vscode

.markdownlint.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"default": true,
3+
"MD029": {
4+
"style": "one"
5+
},
6+
"MD013": true,
7+
"MD024": false,
8+
"MD034": false,
9+
"no-hard-tabs": true
10+
}

.vscode/analyzersettings.psd1

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
@{
2-
<#
3-
For the custom rules to work, the DscResource.Tests repo must be
4-
cloned. It is automatically clone as soon as any unit or
5-
integration tests are run.
6-
#>
7-
CustomRulePath = '.\DSCResource.Tests\DscResource.AnalyzerRules'
8-
9-
IncludeRules = @(
2+
CustomRulePath = '.\output\RequiredModules\DscResource.AnalyzerRules'
3+
includeDefaultRules = $true
4+
IncludeRules = @(
105
# DSC Resource Kit style guideline rules.
116
'PSAvoidDefaultValueForMandatoryParameter',
127
'PSAvoidDefaultValueSwitchParameter',
@@ -43,11 +38,6 @@
4338
'PSUseDeclaredVarsMoreThanAssignments',
4439
'PSUsePSCredentialType',
4540

46-
<#
47-
This is to test all the DSC Resource Kit custom rules.
48-
The name of the function-blocks of each custom rule start
49-
with 'Measure*'.
50-
#>
5141
'Measure-*'
5242
)
5343
}

.vscode/settings.json

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
11
{
22
"powershell.codeFormatting.openBraceOnSameLine": false,
3-
"powershell.codeFormatting.newLineAfterOpenBrace": false,
3+
"powershell.codeFormatting.newLineAfterOpenBrace": true,
44
"powershell.codeFormatting.newLineAfterCloseBrace": true,
55
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
66
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
77
"powershell.codeFormatting.whitespaceAroundOperator": true,
88
"powershell.codeFormatting.whitespaceAfterSeparator": true,
99
"powershell.codeFormatting.ignoreOneLineBlock": false,
10+
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
1011
"powershell.codeFormatting.preset": "Custom",
12+
"powershell.codeFormatting.alignPropertyValuePairs": true,
1113
"files.trimTrailingWhitespace": true,
1214
"files.insertFinalNewline": true,
13-
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1"
15+
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1",
16+
"powershell.scriptAnalysis.enable": true,
17+
"files.associations": {
18+
"*.ps1xml": "xml"
19+
},
20+
"cSpell.words": [
21+
"COMPANYNAME",
22+
"ICONURI",
23+
"LICENSEURI",
24+
"PROJECTURI",
25+
"RELEASENOTES",
26+
"buildhelpers",
27+
"endregion",
28+
"gitversion",
29+
"icontains",
30+
"keepachangelog",
31+
"notin",
32+
"pscmdlet",
33+
"steppable"
34+
],
35+
"[markdown]": {
36+
"files.trimTrailingWhitespace": true,
37+
"files.encoding": "utf8"
38+
}
1439
}

.vscode/tasks.json

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"version": "2.0.0",
3+
"_runner": "terminal",
4+
"windows": {
5+
"options": {
6+
"shell": {
7+
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
8+
"args": [
9+
"-NoProfile",
10+
"-ExecutionPolicy",
11+
"Bypass",
12+
"-Command"
13+
]
14+
}
15+
}
16+
},
17+
"linux": {
18+
"options": {
19+
"shell": {
20+
"executable": "/usr/bin/pwsh",
21+
"args": [
22+
"-NoProfile",
23+
"-Command"
24+
]
25+
}
26+
}
27+
},
28+
"osx": {
29+
"options": {
30+
"shell": {
31+
"executable": "/usr/local/bin/pwsh",
32+
"args": [
33+
"-NoProfile",
34+
"-Command"
35+
]
36+
}
37+
}
38+
},
39+
"tasks": [
40+
{
41+
"label": "build",
42+
"type": "shell",
43+
"command": "&${cwd}/build.ps1",
44+
"args": ["-AutoRestore"],
45+
"presentation": {
46+
"echo": true,
47+
"reveal": "always",
48+
"focus": true,
49+
"panel": "new",
50+
"clear": false
51+
},
52+
"runOptions": {
53+
"runOn": "default"
54+
},
55+
"problemMatcher": [
56+
{
57+
"owner": "powershell",
58+
"fileLocation": [
59+
"absolute"
60+
],
61+
"severity": "error",
62+
"pattern": [
63+
{
64+
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$",
65+
"message": 1
66+
},
67+
{
68+
"regexp": "(.*)",
69+
"code": 1
70+
},
71+
{
72+
"regexp": ""
73+
},
74+
{
75+
"regexp": "^.*,\\s*(.*):\\s*line\\s*(\\d+).*",
76+
"file": 1,
77+
"line": 2
78+
}
79+
]
80+
}
81+
]
82+
},
83+
{
84+
"label": "test",
85+
"type": "shell",
86+
"command": "&${cwd}/build.ps1",
87+
"args": ["-AutoRestore","-Tasks","test"],
88+
"presentation": {
89+
"echo": true,
90+
"reveal": "always",
91+
"focus": true,
92+
"panel": "dedicated",
93+
"showReuseMessage": true,
94+
"clear": false
95+
},
96+
"problemMatcher": [
97+
{
98+
"owner": "powershell",
99+
"fileLocation": [
100+
"absolute"
101+
],
102+
"severity": "error",
103+
"pattern": [
104+
{
105+
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$",
106+
"message": 1
107+
},
108+
{
109+
"regexp": "(.*)",
110+
"code": 1
111+
},
112+
{
113+
"regexp": ""
114+
},
115+
{
116+
"regexp": "^.*,\\s*(.*):\\s*line\\s*(\\d+).*",
117+
"file": 1,
118+
"line": 2
119+
}
120+
]
121+
}
122+
]
123+
}
124+
]
125+
}

CHANGELOG.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Change log for {RepositoryName}
2+
3+
The format is based on and uses the types of changes according to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
6+
## [Unreleased]
7+
8+
### Added
9+
10+
- xWindowsUpdate
11+
- Added automatic release with a new CI pipeline.
12+
- xWindowsUpdateAgent
13+
- Added Retry logic to known transient errors ([issue #24](https://github.com/dsccommunity/xWindowsUpdate/issues/24)).
14+
15+
### Changed
16+
17+
- xWindowsUpdate
18+
- Moved the `Set-StrictMode` so that it is used during testing only and
19+
not during runtime.
20+
- Removed the helper function `Trace-Message` and using the `Write-Verbose`
21+
directly instead.
22+
- The helper function `New-InvalidArgumentException` was replaced by
23+
its equivalent in the module DscResource.Common.
24+
- xWindowsUpdateAgent
25+
- Removed the `$PSCmdlet.ShouldProcess` calls from code since DSC does not
26+
support interactive actions.
27+
- No longer defaults to output verbose messages.
28+
29+
### Removed
30+
31+
- xWindowsUpdate
32+
- BREAKING CHANGE: Removed the deprecated resource `xMicrosoftUpdate`
33+
34+
## [2.8.0.0] - 2019-04-03
35+
36+
- xWindowsUpdateAgent: Fixed verbose statement returning incorrect variable
37+
- Tests no longer fail on `Assert-VerifiableMocks`, these are now renamed
38+
to `Assert-VerifiableMock` (breaking change in Pester v4).
39+
- README.md has been updated with correct description of the resources
40+
([issue #58](https://github.com/dsccommunity/xWindowsUpdate/issues/58)).
41+
- Updated appveyor.yml to use the correct parameters to call the test framework.
42+
- Update appveyor.yml to use the default template.
43+
- Added default template files .gitattributes, and .gitignore, and
44+
.vscode folder.
45+
46+
## [2.7.0.0] - 2017-07-12
47+
48+
- xWindowsUpdateAgent: Fix Get-TargetResource returning incorrect key
49+
50+
## [2.6.0.0] - 2017-03-08
51+
52+
- Converted appveyor.yml to install Pester from PSGallery instead of from
53+
Chocolatey.
54+
- Fixed PSScriptAnalyzer issues.
55+
- Fixed common test breaks (markdown style, and example style).
56+
- Added CodeCov.io reporting
57+
- Deprecated xMicrosoftUpdate as it's functionality is replaced by
58+
xWindowsUpdateAgent
59+
60+
## [2.5.0.0] - 2016-05-18
61+
62+
- Added xWindowsUpdateAgent
63+
64+
## [2.4.0.0] - 2016-03-30
65+
66+
- Fixed PSScriptAnalyzer error in examples
67+
68+
## [2.3.0.0] - 2016-02-02
69+
70+
- MSFT_xWindowsUpdate: Fixed an issue in the Get-TargetResource function,
71+
resulting in the Get-DscConfiguration cmdlet now working appropriately
72+
when the resource is applied.
73+
- MSFT_xWindowsUpdate: Fixed an issue in the Set-TargetResource function
74+
that was causing the function to fail when the installation of a hotfix
75+
did not provide an exit code.
76+
77+
## [2.2.0.0] - 2015-09-11
78+
79+
- Minor fixes
80+
81+
## [2.1.0.0] - 2015-07-24
82+
83+
- Added xMicrosoftUpdate DSC resource which can be used to enable/disable
84+
Microsoft Update in the Windows Update Settings.
85+
86+
### [2.0.0.0] - 2015-04-23
87+
88+
- Initial release with the xHotfix resource

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
This project has adopted the [DSC Community Code of Conduct](https://dsccommunity.org/code_of_conduct).

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Contributing
2+
3+
Please check out common DSC Community [contributing guidelines](https://dsccommunity.org/guidelines/contributing).
4+
5+
## Running the Tests
6+
7+
If want to know how to run this module's tests you can look at the [Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines/#running-tests)

0 commit comments

Comments
 (0)