Skip to content

Commit 6f03291

Browse files
authored
Merge pull request #196 from PowerShell/dev
Release of version 6.0.0.0 of ComputerManagementDsc
2 parents f0af4cc + 32eccd7 commit 6f03291

20 files changed

+891
-62
lines changed

.github/ISSUE_TEMPLATE.md

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

.github/ISSUE_TEMPLATE/General.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: General question or documentation update
3+
about: If you have a general question or documentation update suggestion around the resource module.
4+
---
5+
<!--
6+
Your feedback and support is greatly appreciated, thanks for contributing!
7+
-->
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Problem with a resource
3+
about: If you have a problem, bug, or enhancement with a resource in this resource module.
4+
---
5+
<!--
6+
Your feedback and support is greatly appreciated, thanks for contributing!
7+
8+
ISSUE TITLE:
9+
Please prefix the issue title with the resource name, e.g.
10+
'ResourceName: Short description of my issue'
11+
12+
ISSUE DESCRIPTION (this template):
13+
Please provide information regarding your issue under each header below.
14+
Write N/A under any headers that do not apply to your issue, or if the
15+
information is not available.
16+
17+
NOTE! Sensitive information should be obfuscated.
18+
19+
PLEASE KEEP THE HEADERS.
20+
21+
You may remove this comment block, and the other comment blocks,
22+
but please keep the headers.
23+
-->
24+
#### Details of the scenario you tried and the problem that is occurring
25+
26+
#### Verbose logs showing the problem
27+
28+
#### Suggested solution to the issue
29+
30+
#### The DSC configuration that is used to reproduce the issue (as detailed as possible)
31+
```powershell
32+
# insert configuration here
33+
```
34+
35+
#### The operating system the target node is running
36+
<!--
37+
Please provide as much as possible about the target node, for example
38+
edition, version, build and language.
39+
On OS with WMF 5.1 the following command can help get this information.
40+
41+
Get-ComputerInfo -Property @(
42+
'OsName',
43+
'OsOperatingSystemSKU',
44+
'OSArchitecture',
45+
'WindowsVersion',
46+
'WindowsBuildLabEx',
47+
'OsLanguage',
48+
'OsMuiLanguages')
49+
-->
50+
51+
#### Version and build of PowerShell the target node is running
52+
<!--
53+
To help with this information, please run this command:
54+
$PSVersionTable
55+
-->
56+
57+
#### Version of the DSC module that was used ('dev' if using current dev branch)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: New resource proposal
3+
about: If you have a new resource proposal that you think should be added to this resource module.
4+
---
5+
<!--
6+
Thank you for contributing and making this resource module better!
7+
8+
ISSUE TITLE:
9+
Please prefix the issue title with a proposed resource name,
10+
e.g. 'NewResourceName: New resource proposal'
11+
12+
ISSUE DESCRIPTION (this template):
13+
Please propose the new resource under each header below.
14+
15+
PLEASE KEEP THE HEADERS, but you may remove this comment block.
16+
-->
17+
### Description
18+
19+
### Proposed properties
20+
21+
### Special considerations or limitations

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
11
<!--
2-
Thanks for submitting a Pull Request (PR) to this project. Your contribution to this project is greatly appreciated!
2+
Thanks for submitting a Pull Request (PR) to this project.
3+
Your contribution to this project is greatly appreciated!
34
4-
Please prefix the PR title with the resource name, i.e. 'xComputer: My short description'
5-
If this is a breaking change, then also prefix the PR title with 'BREAKING CHANGE:', i.e. 'BREAKING CHANGE: xComputer: My short description'
5+
Please prefix the PR title with the resource name,
6+
e.g. 'ResourceName: My short description'.
7+
If this is a breaking change, then also prefix the PR title
8+
with 'BREAKING CHANGE:',
9+
e.g. 'BREAKING CHANGE: ResourceName: My short description'.
610
7-
To aid community reviewers in reviewing and merging your PR, please take the time to run through the below checklist.
8-
Change to [x] for each task in the task list that applies to this PR.
11+
You may remove this comment block, and the other comment blocks, but please
12+
keep the headers and the task list.
13+
-->
14+
#### Pull Request (PR) description
15+
<!--
16+
Replace this comment block with a description of your PR.
917
-->
10-
**Pull Request (PR) description**
11-
<!-- Replace this with a description of your pull request -->
1218

13-
**This Pull Request (PR) fixes the following issues:**
14-
<!-- Replace this with the list of issues or n/a. Use format: Fixes #123 -->
19+
#### This Pull Request (PR) fixes the following issues
20+
<!--
21+
If this PR does not fix an open issue, replace this comment block with None.
22+
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+
-->
1527

16-
**Task list:**
17-
- [ ] Change details added to Unreleased section of CHANGELOG.md?
18-
- [ ] Added/updated documentation, comment-based help and descriptions in .schema.mof files where appropriate?
19-
- [ ] Examples appropriately updated?
20-
- [ ] New/changed code adheres to [Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md)?
21-
- [ ] [Unit and (optional) Integration tests](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md) created/updated where possible?
28+
#### Task list
29+
<!--
30+
To aid community reviewers in reviewing and merging your PR, please take
31+
the time to run through the below checklist and make sure your PR has
32+
everything updated as required.
33+
34+
Change to [x] for each task in the task list that applies to your PR.
35+
For those task that don't apply to you PR, leave those as is.
36+
-->
37+
- [ ] Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
38+
Entry should say what was changed, and how that affects users (if applicable).
39+
- [ ] Resource documentation added/updated in README.md in the resource folder.
40+
- [ ] Resource parameter descriptions added/updated in schema.mof
41+
and comment-based help.
42+
- [ ] Comment-based help added/updated.
43+
- [ ] Localization strings added/updated in all localization files as appropriate.
44+
- [ ] 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).

.vscode/analyzersettings.psd1

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
@{
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 = @(
10+
# DSC Resource Kit style guideline rules.
11+
'PSAvoidDefaultValueForMandatoryParameter',
12+
'PSAvoidDefaultValueSwitchParameter',
13+
'PSAvoidInvokingEmptyMembers',
14+
'PSAvoidNullOrEmptyHelpMessageAttribute',
15+
'PSAvoidUsingCmdletAliases',
16+
'PSAvoidUsingComputerNameHardcoded',
17+
'PSAvoidUsingDeprecatedManifestFields',
18+
'PSAvoidUsingEmptyCatchBlock',
19+
'PSAvoidUsingInvokeExpression',
20+
'PSAvoidUsingPositionalParameters',
21+
'PSAvoidShouldContinueWithoutForce',
22+
'PSAvoidUsingWMICmdlet',
23+
'PSAvoidUsingWriteHost',
24+
'PSDSCReturnCorrectTypesForDSCFunctions',
25+
'PSDSCStandardDSCFunctionsInResource',
26+
'PSDSCUseIdenticalMandatoryParametersForDSC',
27+
'PSDSCUseIdenticalParametersForDSC',
28+
'PSMisleadingBacktick',
29+
'PSMissingModuleManifestField',
30+
'PSPossibleIncorrectComparisonWithNull',
31+
'PSProvideCommentHelp',
32+
'PSReservedCmdletChar',
33+
'PSReservedParams',
34+
'PSUseApprovedVerbs',
35+
'PSUseCmdletCorrectly',
36+
'PSUseOutputTypeCorrectly',
37+
'PSAvoidGlobalVars',
38+
'PSAvoidUsingConvertToSecureStringWithPlainText',
39+
'PSAvoidUsingPlainTextForPassword',
40+
'PSAvoidUsingUsernameAndPasswordParams',
41+
'PSDSCUseVerboseMessageInDSCResource',
42+
'PSShouldProcess',
43+
'PSUseDeclaredVarsMoreThanAssignments',
44+
'PSUsePSCredentialType',
45+
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+
#>
51+
'Measure-*'
52+
)
53+
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"powershell.codeFormatting.ignoreOneLineBlock": false,
1111
"powershell.codeFormatting.preset": "Custom",
1212
"files.trimTrailingWhitespace": true,
13-
"files.insertFinalNewline": true
13+
"files.insertFinalNewline": true,
14+
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1"
1415
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
## Unreleased
44

5+
## 6.0.0.0
6+
7+
- ScheduledTask:
8+
- Added support for Group Managed Service Accounts, implemented using the ExecuteAsGMSA
9+
parameter. Fixes [Issue #111](https://github.com/PowerShell/ComputerManagementDsc/issues/111)
10+
- Added support to set the Synchronize Across Time Zone option. Fixes [Issue #109](https://github.com/PowerShell/ComputerManagementDsc/issues/109)
11+
- Added .VSCode settings for applying DSC PSSA rules - fixes [Issue #189](https://github.com/PowerShell/ComputerManagementDsc/issues/189).
12+
- BREAKING CHANGE: PowerPlan:
13+
- Added IsActive Read-Only Property - Fixes [Issue #171](https://github.com/PowerShell/ComputerManagementDsc/issues/171).
14+
- InActive power plans are no longer returned with their Name set to null.
15+
Now, the name is always returned and the Read-Only property of IsActive
16+
is set accordingly.
17+
518
## 5.2.0.0
619

720
- PowershellExecutionPolicy:

Modules/ComputerManagementDsc/ComputerManagementDsc.psd1

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@{
22
# Version number of this module.
3-
moduleVersion = '5.2.0.0'
3+
moduleVersion = '6.0.0.0'
44

55
# ID used to uniquely identify this module
66
GUID = 'B5004952-489E-43EA-999C-F16A25355B89'
@@ -49,16 +49,16 @@ PrivateData = @{
4949
# IconUri = ''
5050

5151
# ReleaseNotes of this module
52-
ReleaseNotes = '- PowershellExecutionPolicy:
53-
- Updated to meet HQRM guidelines.
54-
- Migrated the xPowershellExecutionPolicy from [xPowershellExecutionPolicy](https://github.com/PowerShell/xPowerShellExecutionPolicy)
55-
and renamed to PowershellExecutionPolicy.
56-
- Moved strings to localization file.
57-
- Changed the scope from Global to Script in MSFT_ScheduledTask.Integration.Tests.ps1
58-
- Changed the scope from Global to Script ComputerManagementDsc.Common.Tests.ps1
59-
- ScheduledTask:
60-
- Added support for event based triggers, implemented using the ScheduleType OnEvent
61-
fixes [Issue 167](https://github.com/PowerShell/ComputerManagementDsc/issues/167)
52+
ReleaseNotes = '- ScheduledTask:
53+
- Added support for Group Managed Service Accounts, implemented using the ExecuteAsGMSA
54+
parameter. Fixes [Issue 111](https://github.com/PowerShell/ComputerManagementDsc/issues/111)
55+
- Added support to set the Synchronize Across Time Zone option. Fixes [Issue 109](https://github.com/PowerShell/ComputerManagementDsc/issues/109)
56+
- Added .VSCode settings for applying DSC PSSA rules - fixes [Issue 189](https://github.com/PowerShell/ComputerManagementDsc/issues/189).
57+
- BREAKING CHANGE: PowerPlan:
58+
- Added IsActive Read-Only Property - Fixes [Issue 171](https://github.com/PowerShell/ComputerManagementDsc/issues/171).
59+
- InActive power plans are no longer returned with their Name set to null.
60+
Now, the name is always returned and the Read-Only property of IsActive
61+
is set accordingly.
6262
6363
'
6464

@@ -69,3 +69,4 @@ PrivateData = @{
6969

7070

7171

72+

Modules/ComputerManagementDsc/DSCResources/MSFT_PowerPlan/MSFT_PowerPlan.psm1

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ function Get-TargetResource
6767
if ($plan.IsActive)
6868
{
6969
Write-Verbose -Message ($script:localizedData.PowerPlanIsActive -f $Name)
70-
$activePlanName = $Name
7170
}
7271
else
7372
{
7473
Write-Verbose -Message ($script:localizedData.PowerPlanIsNotActive -f $Name)
75-
$activePlanName = $null
7674
}
7775
}
7876
else
@@ -83,7 +81,8 @@ function Get-TargetResource
8381

8482
return @{
8583
IsSingleInstance = $IsSingleInstance
86-
Name = $activePlanName
84+
Name = $Name
85+
IsActive = $plan.IsActive
8786
}
8887
}
8988

@@ -177,18 +176,11 @@ function Test-TargetResource
177176
$Name
178177
)
179178

180-
$returnValue = $false
181-
182179
Write-Verbose -Message ($script:localizedData.PowerPlanIsBeingValidated -f $Name)
183180

184181
$getTargetResourceResult = Get-TargetResource -IsSingleInstance $IsSingleInstance -Name $Name
185182

186-
if ($getTargetResourceResult.Name -eq $Name)
187-
{
188-
$returnValue = $true
189-
}
190-
191-
return $returnValue
183+
return $getTargetResourceResult.IsActive
192184
}
193185

194186
Export-ModuleMember -Function *-TargetResource

0 commit comments

Comments
 (0)