Skip to content

Commit

Permalink
Merge pull request #35 from mgreenegit/dev
Browse files Browse the repository at this point in the history
Reviewed changes.  Thank you for doing all of this!
  • Loading branch information
mgreenegit authored Mar 13, 2019
2 parents f4c9e86 + 645c429 commit e28d2de
Show file tree
Hide file tree
Showing 20 changed files with 296 additions and 28 deletions.
10 changes: 8 additions & 2 deletions .MetaTestOptIn.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
[
"Common Tests - Validate Module Files",
"Common Tests - Validate Markdown Files",
"Common Tests - Validate Example Files",
"Common Tests - Validate Script Files"
"Common Tests - Validate Module Files",
"Common Tests - Validate Script Files",
"Common Tests - Required Script Analyzer Rules",
"Common Tests - Flagged Script Analyzer Rules",
"Common Tests - New Error-Level Script Analyzer Rules",
"Common Tests - Custom Script Analyzer Rules",
"Common Tests - Relative Path Length",
"Common Tests - Validate Markdown Links"
]
24 changes: 24 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
codecov:
notify:
require_ci_to_pass: no

comment:
layout: "reach, diff"
behavior: default

coverage:
range: 50..80
round: down
precision: 0

status:
project:
default:
# Set the overall project code coverage requirement to 70%
target: 70
patch:
default:
# Set the pull request requirement to not regress overall coverage by more than 5%
# and let codecov.io set the goal for the code changed in the patch.
target: auto
threshold: 5
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Needed for publishing of examples, build worker defaults to core.autocrlf=input.
* text eol=crlf
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/General.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: General question or documentation update
about: If you have a general question or documentation update suggestion around the resource module.
---
<!--
Your feedback and support is greatly appreciated, thanks for contributing!
-->
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/Problem_with_resource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: Problem with a resource
about: If you have a problem, bug, or enhancement with a resource in this resource module.
---
<!--
Your feedback and support is greatly appreciated, thanks for contributing!
ISSUE TITLE:
Please prefix the issue title with the resource name, e.g.
'ResourceName: Short description of my issue'
ISSUE DESCRIPTION (this template):
Please provide information regarding your issue under each header below.
Write N/A under any headers that do not apply to your issue, or if the
information is not available.
NOTE! Sensitive information should be obfuscated.
PLEASE KEEP THE HEADERS.
You may remove this comment block, and the other comment blocks,
but please keep the headers.
-->
#### Details of the scenario you tried and the problem that is occurring

#### Verbose logs showing the problem

#### Suggested solution to the issue

#### The DSC configuration that is used to reproduce the issue (as detailed as possible)
```powershell
# insert configuration here
```

#### The operating system the target node is running
<!--
Please provide as much as possible about the target node, for example
edition, version, build and language.
On OS with WMF 5.1 the following command can help get this information.
Get-ComputerInfo -Property @(
'OsName',
'OsOperatingSystemSKU',
'OSArchitecture',
'WindowsVersion',
'WindowsBuildLabEx',
'OsLanguage',
'OsMuiLanguages')
-->

#### Version and build of PowerShell the target node is running
<!--
To help with this information, please run this command:
$PSVersionTable
-->

#### Version of the DSC module that was used ('dev' if using current dev branch)
<!--
To help with this information, please run this command:
Get-Module -Name 'SqlServerDsc' -ListAvailable | ft Name,Version,Path
-->
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/Resource_proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: New resource proposal
about: If you have a new resource proposal that you think should be added to this resource module.
---
<!--
Thank you for contributing and making this resource module better!
ISSUE TITLE:
Please prefix the issue title with a proposed resource name,
e.g. 'NewResourceName: New resource proposal'
ISSUE DESCRIPTION (this template):
Please propose the new resource under each header below.
PLEASE KEEP THE HEADERS, but you may remove this comment block.
-->
### Description

### Proposed properties

### Special considerations or limitations
50 changes: 50 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--
Thanks for submitting a Pull Request (PR) to this project.
Your contribution to this project is greatly appreciated!
Please make sure you have read the contributing section
at https://github.com/PowerShell/SqlServerDsc#contributing.
Please prefix the PR title with the resource name,
e.g. 'ResourceName: My short description'.
If this is a breaking change, then also prefix the PR title
with 'BREAKING CHANGE:',
e.g. 'BREAKING CHANGE: ResourceName: My short description'.
You may remove this comment block, and the other comment blocks, but please
keep the headers and the task list.
-->
#### Pull Request (PR) description
<!--
Replace this comment block with a description of your PR.
-->

#### This Pull Request (PR) fixes the following issues
<!--
If this PR does not fix an open issue, replace this comment block with None.
If this PR resolves one or more open issues, replace this comment block with
a list the issues using a GitHub closing keyword, e.g.:
- Fixes #123
- Fixes #124
-->

#### Task list
<!--
To aid community reviewers in reviewing and merging your PR, please take
the time to run through the below checklist and make sure your PR has
everything updated as required.
Change to [x] for each task in the task list that applies to your PR.
For those task that don't apply to you PR, leave those as is.
-->
- [ ] Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
Entry should say what was changed, and how that affects users (if applicable).
- [ ] Resource documentation added/updated in README.md.
- [ ] Resource parameter descriptions added/updated in README.md, schema.mof
and comment-based help.
- [ ] Comment-based help added/updated.
- [ ] Localization strings added/updated in all localization files as appropriate.
- [ ] Examples appropriately added/updated.
- [ ] Unit tests added/updated. See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
- [ ] Integration tests added/updated (where possible). See [DSC Resource Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md).
- [ ] 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).
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DSCResource.Tests
53 changes: 53 additions & 0 deletions .vscode/analyzersettings.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@{
<#
For the custom rules to work, the DscResource.Tests repo must be
cloned. It is automatically clone as soon as any unit or
integration tests are run.
#>
CustomRulePath = '.\DSCResource.Tests\DscResource.AnalyzerRules'

IncludeRules = @(
# DSC Resource Kit style guideline rules.
'PSAvoidDefaultValueForMandatoryParameter',
'PSAvoidDefaultValueSwitchParameter',
'PSAvoidInvokingEmptyMembers',
'PSAvoidNullOrEmptyHelpMessageAttribute',
'PSAvoidUsingCmdletAliases',
'PSAvoidUsingComputerNameHardcoded',
'PSAvoidUsingDeprecatedManifestFields',
'PSAvoidUsingEmptyCatchBlock',
'PSAvoidUsingInvokeExpression',
'PSAvoidUsingPositionalParameters',
'PSAvoidShouldContinueWithoutForce',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingWriteHost',
'PSDSCReturnCorrectTypesForDSCFunctions',
'PSDSCStandardDSCFunctionsInResource',
'PSDSCUseIdenticalMandatoryParametersForDSC',
'PSDSCUseIdenticalParametersForDSC',
'PSMisleadingBacktick',
'PSMissingModuleManifestField',
'PSPossibleIncorrectComparisonWithNull',
'PSProvideCommentHelp',
'PSReservedCmdletChar',
'PSReservedParams',
'PSUseApprovedVerbs',
'PSUseCmdletCorrectly',
'PSUseOutputTypeCorrectly',
'PSAvoidGlobalVars',
'PSAvoidUsingConvertToSecureStringWithPlainText',
'PSAvoidUsingPlainTextForPassword',
'PSAvoidUsingUsernameAndPasswordParams',
'PSDSCUseVerboseMessageInDSCResource',
'PSShouldProcess',
'PSUseDeclaredVarsMoreThanAssignments',
'PSUsePSCredentialType',

<#
This is to test all the DSC Resource Kit custom rules.
The name of the function-blocks of each custom rule start
with 'Measure*'.
#>
'Measure-*'
)
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterOpenBrace": false,
"powershell.codeFormatting.newLineAfterCloseBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.preset": "Custom",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Change log for UpdateServicesDsc

## Unreleased

- Update for HQRM standard
- Changes to Project layout

## 1.0.75.0

- bug fixes

## 1.0.72.0

- First release of UpdateServicesDsc
6 changes: 6 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Code of conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [[email protected]](mailto:[email protected]) with any additional
questions or comments.
2 changes: 1 addition & 1 deletion DSCResource.Tests
Submodule DSCResource.Tests updated from e7b358 to 6a0936
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Import-Module $currentPath\..\..\UpdateServicesHelper.psm1 -Verbose:$false -Erro
.SYNOPSIS
Returns the current CleanUp Task
.PARAMETER Ensure
Determinse if the task should be added or removed
Determines if the task should be added or removed
#>
function Get-TargetResource
{
Expand All @@ -37,22 +37,29 @@ function Get-TargetResource
$Arguments = $Task.Actions.Arguments
if($Arguments)
{
$Arguments = $Arguments.Split("`"")
$Arguments = $Arguments.Split('"')
if($Arguments.Count -ge 1)
{
$Arguments = $Arguments[1].Split(";")
foreach($Var in @(
$ArgumentNames = @(
"DeclineSupersededUpdates",
"DeclineExpiredUpdates",
"CleanupObsoleteUpdates",
"CompressUpdates",
"CleanupObsoleteComputers",
"CleanupUnneededContentFiles",
"CleanupLocalPublishedContentFiles"
))
)
foreach ($Var in $Arguments)
{
Set-Variable -Name $Var -Value (Invoke-Expression((($Arguments `
| Where-Object -FilterScript {$_ -like "`$$Var = *"}) -split " = ")[1]))
$regex = [regex]'^\$(?<name>.*)\s=\s\$(?<value>.*)$'
$groups = $regex.Match($Var).Groups
$VarName = $groups['name'].value.Trim()
$VarValueString = $groups['value'].value.Trim()
if($VarName -in $ArgumentNames)
{
Set-variable -Name $VarName -Value $ExecutionContext.InvokeCommand.ExpandString($VarValueString)
}
}
}
}
Expand Down Expand Up @@ -201,7 +208,7 @@ if(`$WsusServer)
"@

Write-Verbose "Creating new scheduled task for WSUS cleanup rule"

$Action = New-ScheduledTaskAction -Execute $Command -Argument $Argument
$Trigger = New-ScheduledTaskTrigger -Daily -At $TimeOfDay
Register-ScheduledTask -TaskName "WSUS Cleanup" -Action $Action -Trigger $Trigger -RunLevel Highest -User "SYSTEM"
Expand Down Expand Up @@ -327,7 +334,7 @@ function Test-TargetResource
$result = $false
}
}

$result
}

Expand Down
Loading

0 comments on commit e28d2de

Please sign in to comment.