From 022698b861aeea0cdcb1a904c43e7ec9f1b10553 Mon Sep 17 00:00:00 2001 From: Michael Greene Date: Wed, 27 Feb 2019 09:41:57 -0600 Subject: [PATCH 1/4] cleanup old text in readme --- ReadMe.md | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index c41834a..3ad35af 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -6,18 +6,6 @@ The **UpdateServicesDsc** module is a part of the Windows PowerShell Desired Sta This module contains the **UpdateServicesApprovalRule, UpdateServicesCleanup, and UpdateServicesServer** resources. -**All of the resources in the DSC Resource Kit are provided AS IS, and are not supported through any Microsoft standard support program or service. The "x" in xStorage stands for experimental**, which means that these resources will be **fix forward** and monitored by the module owner(s). - -Please leave comments, feature requests, and bug reports in the Q & A tab for this module. - -If you would like to modify this module, feel free. -When modifying, please update the module name, resource friendly name, and MOF class name (instructions below). -As specified in the license, you may copy or modify this resource as long as they are used on the Windows Platform. - -For more information about Windows PowerShell Desired State Configuration, check out the blog posts on the [PowerShell Blog](http://blogs.msdn.com/b/powershell/) ([this](http://blogs.msdn.com/b/powershell/archive/2013/11/01/configuration-in-a-devops-world-windows-powershell-desired-state-configuration.aspx) is a good starting point). -There are also great community resources, such as [PowerShell.org](http://powershell.org/wp/tag/dsc/), or [PowerShell Magazine](http://www.powershellmagazine.com/tag/dsc/). -For more information on the DSC Resource Kit, checkout [this blog post](http://go.microsoft.com/fwlink/?LinkID=389546). - ## Installation To install **UpdateServicesDsc** module, on a machine with Windows Management Framework version 5 or newer from an elevated PowerShell session run: @@ -85,22 +73,6 @@ This module requires a minimum version of PowerShell v5.0. - **Synchronize**: Begin initial synchronization. - **RunRuleNow**: Run Approval Rule on existing content. -## Renaming Requirements - -When making changes to these resources, we suggest the following practice - -1. Update the following names by replacing MSFT with your company/community name or another prefix of your choice. -- Module name (ex: xModule becomes cModule) -- Resource folder (ex: MSFT\_xResource becomes Contoso\_xResource) -- Resource Name (ex: MSFT\_xResource becomes Contoso\_cResource) -- Resource Friendly Name (ex: xResource becomes cResource) -- MOF class name (ex: MSFT\_xResource becomes Contoso\_cResource) -- Filename for the .schema.mof (ex: MSFT\_xResource.schema.mof becomes Contoso\_cResource.schema.mof) -1. Update module and metadata information in the module manifest -1. Update any configuration that use these resources - -We reserve resource and module names without prefixes for future use (e.g. "MSFT_Resource"). - 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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. From 81be65682e3ea02d3e6993e7dd0edc9b6ebed580 Mon Sep 17 00:00:00 2001 From: Michael Greene Date: Wed, 27 Feb 2019 09:52:28 -0600 Subject: [PATCH 2/4] version. readme style. --- ReadMe.md | 203 ++++++++++++++++++++++++++++------------- UpdateServicesDsc.psd1 | 2 +- appveyor.yml | 85 ++++++++--------- 3 files changed, 185 insertions(+), 105 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 3ad35af..ea37f5e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,117 +1,194 @@ # UpdateServicesDsc +The **UpdateServicesDsc** module contains DSC resources +for deployment and configuration of Windows Server Update Services. + +This project has adopted [this code of conduct](CODE_OF_CONDUCT.md). + +## Branches + +### master + [![Build status](https://ci.appveyor.com/api/projects/status/wncsr23e1fqbv4nt?svg=true)](https://ci.appveyor.com/project/mgreenegit/UpdateServicesDsc) +[![codecov](https://codecov.io/gh/mgreenegit/UpdateServicesDsc/branch/master/graph/badge.svg)](https://codecov.io/gh/mgreenegit/UpdateServicesDsc/branch/master) + +This is the branch containing the latest release - +no contributions should be made directly to this branch. + +### dev +[![Build status](https://ci.appveyor.com/api/projects/status/wncsr23e1fqbv4nt/branch/dev??svg=true)](https://ci.appveyor.com/project/mgreenegit/UpdateServicesDsc/branch/dev) +[![codecov](https://codecov.io/gh/mgreenegit/UpdateServicesDsc/branch/dev/graph/badge.svg)](https://codecov.io/gh/mgreenegit/UpdateServicesDsc/branch/dev) + +This is the development branch +to which contributions should be proposed by contributors as pull requests. +This development branch will periodically be merged to the master branch, +and be released to [PowerShell Gallery](https://www.powershellgallery.com/). -The **UpdateServicesDsc** module is a part of the Windows PowerShell Desired State Configuration (DSC) Resource Kit, which is a collection of DSC Resources. +## Contributing -This module contains the **UpdateServicesApprovalRule, UpdateServicesCleanup, and UpdateServicesServer** resources. +Regardless of the way you want to contribute +we are tremendously happy to have you here. + +There are several ways you can contribute. +You can submit an issue to report a bug. +You can submit an issue to request an improvement. +You can take part in discussions for issues. +You can review pull requests and comment on other contributors changes. +You can also improve the resources and tests, +or even create new resources, +by sending in pull requests yourself. + +* If you want to submit an issue or take part in discussions, + please browse the list of [issues](https://github.com/mgreenegit/UpdateServicesDsc/issues). + Please check out [Contributing to the DSC Resource Kit](https://github.com/PowerShell/DscResources/blob/master/CONTRIBUTING.md) + on how to work with issues. +* If you want to review pull requests, + please first check out the [Review Pull Request guidelines](https://github.com/PowerShell/DscResources/blob/master/CONTRIBUTING.md#reviewing-pull-requests), + and the browse the list of [pull requests](https://github.com/mgreenegit/UpdateServicesDsc/pulls) + and look for those pull requests with label 'needs review'. +* If you want to improve this resource module, + then please check out the following guidelines. + * The specific [Contributing to SqlServerDsc](https://github.com/mgreenegit/UpdateServicesDsc/blob/dev/CONTRIBUTING.md) + guidelines. + * The common [Style Guidelines & Best Practices](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md). + * The common [Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md). + * If you are new to GitHub (and git), + then please check out [Getting Started with GitHub](https://github.com/PowerShell/DscResources/blob/master/GettingStartedWithGitHub.md). + * If you are new to Pester and writing test, then please check out + [Getting started with Pester](https://github.com/PowerShell/DscResources/blob/master/GettingStartedWithPester.md). + +If you need any help along the way, +don't be afraid to ask. +We are here for each other. ## Installation -To install **UpdateServicesDsc** module, on a machine with Windows Management Framework version 5 or newer from an elevated PowerShell session run: +### From GitHub source code + +To manually install the module, download the source code from GitHub and unzip +the contents to the '$env:ProgramFiles\WindowsPowerShell\Modules' folder. + +### From PowerShell Gallery + +To install from the PowerShell gallery using PowerShellGet (in PowerShell 5.0) +run the following command: -```PowerShell -Install-Module UpdateServicesDsc +```powershell +Find-Module -Name SqlServerDsc | Install-Module ``` -To confirm installation +To confirm installation, run the below command and ensure you see the SQL Server +DSC resources available: -```PowerShell -Get-DSCResource UpdateServicesDsc +```powershell +Get-DscResource -Module SqlServerDsc ``` ## Requirements -This module requires a minimum version of PowerShell v5.0. +The minimum Windows Management Framework (PowerShell) version required is 5.0 +or higher, which ships with Windows 10 or Windows Server 2016, +but can also be installed on Windows 7 SP1, Windows 8.1, +Windows Server 2008 R2 SP1, Windows Server 2012 and Windows Server 2012 R2. ## Details **UpdateServicesApprovalRule** resource has following properties -- **Ensure**: An enumerated value that describes if the ApprovalRule is available -- **Name**: Name of the approval rule. -- **Classifications**: Classifications in the approval rule. -- **Products**: Products in the approval rule. -- **ComputerGroups**: Computer groups the approval rule applies to. -- **Enabled**: Whether the approval rule is enabled. -- **Synchronize**: Synchronize after creating or updating the approval rule. +* **Ensure**: An enumerated value that describes if the ApprovalRule is available +* **Name**: Name of the approval rule. +* **Classifications**: Classifications in the approval rule. +* **Products**: Products in the approval rule. +* **ComputerGroups**: Computer groups the approval rule applies to. +* **Enabled**: Whether the approval rule is enabled. +* **Synchronize**: Synchronize after creating or updating the approval rule. **UpdateServicesCleanup** resource has following properties: -- **Ensure**: An enumerated value that describes if the WSUS cleanup task exists. -- **DeclineSupersededUpdates**: Decline updates that have not been approved fo 30 days or more, are not currently needed by any clients, and are superseded by an approved update. -- **DeclineExpiredUpdates**: Decline updates that aren't approved and have been expired by Microsoft. -- **CleanupObsoleteUpdates**: Delete updates that are expired and have not been approved for 30 days or more, and delete older update revisions that have not been approved for 30 days or more. -- **CompressUpdates**: Compress updates. -- **CleanupObsoleteComputers**: Delete computers that have not contacted the server in 30 days or more. -- **CleanupUnneededContentFiles**: Delete update files that aren't needed by updates or downstream servers. -- **CleanupLocalPublishedContentFiles**: Cleanup local published content files. -- **TimeOfDay** Time of day to start cleanup. +* **Ensure**: An enumerated value that describes if the WSUS cleanup task exists. +* **DeclineSupersededUpdates**: Decline updates that have not been approved fo 30 days or more, are not currently needed by any clients, and are superseded by an approved update. +* **DeclineExpiredUpdates**: Decline updates that aren't approved and have been expired by Microsoft. +* **CleanupObsoleteUpdates**: Delete updates that are expired and have not been approved for 30 days or more, and delete older update revisions that have not been approved for 30 days or more. +* **CompressUpdates**: Compress updates. +* **CleanupObsoleteComputers**: Delete computers that have not contacted the server in 30 days or more. +* **CleanupUnneededContentFiles**: Delete update files that aren't needed by updates or downstream servers. +* **CleanupLocalPublishedContentFiles**: Cleanup local published content files. +* **TimeOfDay** Time of day to start cleanup. **UpdateServicesServer** resource has following properties: -- **Ensure**: An enumerated value that describes if WSUS is configured. -- **SetupCredential**: Credential to be used to perform the initial configuration. -- **SQLServer**: SQL Server for the WSUS database, omit for Windows Internal Database. -- **ContentDir**: Folder for WSUS update files. -- **UpdateImprovementProgram**: Join the Microsoft Update Improvement Program. -- **UpstreamServerName**: Upstream WSUS server, omit for Microsoft Update. -- **UpstreamServerPort**: Port of upstream WSUS server. -- **UpstreamServerSSL**: Use SSL with upstream WSUS server. -- **UpstreamServerReplica**: Replica of upstream WSUS server. -- **ProxyServerName**: Proxy server to use when synchronizing, omit for no proxy. -- **ProxyServerPort**: Proxy server port. -- **ProxyServerCredential**: Proxy server credential, omit for anonymous. -- **ProxyServerCredentialUsername**: Proxy server credential username. -- **ProxyServerBasicAuthentication**: Allow proxy server basic authentication. -- **Languages**: Update languages, * for all. -- **Products**: Update products, * for all. -- **Classifications**: Update classifications, * for all. -- **SynchronizeAutomatically**: Synchronize automatically. -- **SynchronizeAutomaticallyTimeOfDay**: First synchronization. -- **SynchronizationsPerDay**: Synchronizations per day. -- **Synchronize**: Begin initial synchronization. -- **RunRuleNow**: Run Approval Rule on existing content. +* **Ensure**: An enumerated value that describes if WSUS is configured. +* **SetupCredential**: Credential to be used to perform the initial configuration. +* **SQLServer**: SQL Server for the WSUS database, omit for Windows Internal Database. +* **ContentDir**: Folder for WSUS update files. +* **UpdateImprovementProgram**: Join the Microsoft Update Improvement Program. +* **UpstreamServerName**: Upstream WSUS server, omit for Microsoft Update. +* **UpstreamServerPort**: Port of upstream WSUS server. +* **UpstreamServerSSL**: Use SSL with upstream WSUS server. +* **UpstreamServerReplica**: Replica of upstream WSUS server. +* **ProxyServerName**: Proxy server to use when synchronizing, omit for no proxy. +* **ProxyServerPort**: Proxy server port. +* **ProxyServerCredential**: Proxy server credential, omit for anonymous. +* **ProxyServerCredentialUsername**: Proxy server credential username. +* **ProxyServerBasicAuthentication**: Allow proxy server basic authentication. +* **Languages**: Update languages, * for all. +* **Products**: Update products, * for all. +* **Classifications**: Update classifications, * for all. +* **SynchronizeAutomatically**: Synchronize automatically. +* **SynchronizeAutomaticallyTimeOfDay**: First synchronization. +* **SynchronizationsPerDay**: Synchronizations per day. +* **Synchronize**: Begin initial synchronization. +* **RunRuleNow**: Run Approval Rule on existing content. 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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Versions +### 1.1.0 + +* Resolve feedback for HQRM +* Accept PR for client side targeting + ### 1.0.76.0 -- Fixed PSSA rule override +* Fixed PSSA rule override ### 1.0.75.0 -- Adjusted PDT to let processes run for up to 3 minutes +* Adjusted PDT to let processes run for up to 3 minutes ### 1.0.74.0 -- Test issues - - A number of PSSA rules evolved since the tests were written. Made all corrections. +* Test issues + * A number of PSSA rules evolved since the tests were written. Made all corrections. ### 1.0.73.0 -- Resolve issues - - Get was failing during deployment because ReferenceObject was null +* Resolve issues + * Get was failing during deployment because ReferenceObject was null ### 1.0.47.0 -- High quality DSC module with the following updates: - - Rename to WSUSDsc - - Add Integration tests - - Fix typo in ReadMe - - Add RunRuleNow param to WSUSApprovalRule resource - - Fix error in WSUSServer resource causing Get- to fail +* High quality DSC module with the following updates: + * Rename to WSUSDsc + * Add Integration tests + * Fix typo in ReadMe + * Add RunRuleNow param to WSUSApprovalRule resource + * Fix error in WSUSServer resource causing Get- to fail ### 1.0.0.0 -- Initial release of xWSUS module with coverage for the following areas: - - Managing xWSUS rules for content synchronization. - - Managing xWSUS rules for content cleanup and compression. - - Managing xWSUS service configuration +* Initial release of xWSUS module with coverage for the following areas: + * Managing xWSUS rules for content synchronization. + * Managing xWSUS rules for content cleanup and compression. + * Managing xWSUS service configuration ## Contributing Please check out common DSC Resources [contributing guidelines](https://github.com/PowerShell/DscResource.Kit/blob/master/CONTRIBUTING.md). + +Thank you +[SqlServerDsc](https://github.com/PowerShell/SqlServerDsc/blob/dev/README.md) +maintainers for your awesome work on style and structure for DSC README files, +which is copied here. diff --git a/UpdateServicesDsc.psd1 b/UpdateServicesDsc.psd1 index 96c2444..053b584 100644 --- a/UpdateServicesDsc.psd1 +++ b/UpdateServicesDsc.psd1 @@ -12,7 +12,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '1.0.76.0' +ModuleVersion = '1.1.0.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/appveyor.yml b/appveyor.yml index 387b318..e26471e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,13 +1,34 @@ +################################################################################ +# This is the template for appveyor.yml which uses the "default model" of the +# test framework in https://github.com/PowerShell/DscResource.Tests. +# +# This template assumes you have connected your repository to AppVeyor +# (https://ci.appveyor.com). +# +# Before using it in your repository, modify places marked with 'TODO:', and +# then remove this comment block. +################################################################################ + #---------------------------------# # environment configuration # #---------------------------------# -version: 1.0.75.{build} + +version: 1.1.{build}.0 # TODO: Modify version so it fits your versioning. +environment: + gallery_api: + # TODO: Change to the correct API key if using PowerShell Gallery deploy task. + # If you wish to use this to publish your own module you'd need to set your + # own API key (encrypted by https://ci.appveyor.com/tools/encrypt). + # + # This API key can only be decrypted by the PowerShell Team's AppVeyor account, + # and can only be used for resource modules under the DSC Resource Kit. + secure: 9ekJzfsPCDBkyLrfmov83XbbhZ6E2N3z+B/Io8NbDetbHc6hWS19zsDmy7t0Vvxv + install: - - git clone https://github.com/PowerShell/DscResource.Tests - - ps: | - Import-Module .\DscResource.Tests\TestHelper.psm1 -force - Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.205 -Force - Install-Module -Name Pester -Repository PSGallery -Force + - git clone https://github.com/PowerShell/DscResource.Tests + - ps: Write-Verbose -Message "PowerShell version $($PSVersionTable.PSVersion)" -Verbose + - ps: Import-Module -Name "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1" + - ps: Invoke-AppveyorInstallTask #---------------------------------# # build configuration # @@ -21,39 +42,21 @@ build: false test_script: - ps: | - $testResultsFile = ".\TestsResults.xml" - $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru - (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) - if ($res.FailedCount -gt 0) { - throw "$($res.FailedCount) tests failed." - } - -#---------------------------------# -# deployment configuration # -#---------------------------------# - -# scripts to run before deployment -deploy_script: + # TODO: + # To use -CodeCovIo parameter, the repository need to connected + # to Codecov (see https://codecov.io/). + Invoke-AppveyorTestScriptTask -CodeCoverage -CodeCovIo + +# scripts to run before deployment +after_test: + - ps: | + Import-Module -Name "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1" + Invoke-AppveyorAfterTestTask + +#---------------------------------# +# deployment configuration # +#---------------------------------# + +deploy_script: - ps: | - # Creating project artifact - $stagingDirectory = (Resolve-Path ..).Path - #$manifest = Join-Path $pwd "UpdateServicesDSC.psd1" - #(Get-Content $manifest -Raw).Replace("1.0.x.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest - $zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip" - Add-Type -assemblyname System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath) - - # Creating NuGet package artifact - New-Nuspec -packageName $env:APPVEYOR_PROJECT_NAME -version $env:APPVEYOR_BUILD_VERSION -author "Microsoft" -owners "Microsoft" -licenseUrl "https://github.com/PowerShell/DscResources/blob/master/LICENSE" -projectUrl "https://github.com/$($env:APPVEYOR_REPO_NAME)" -packageDescription $env:APPVEYOR_PROJECT_NAME -tags "DesiredStateConfiguration DSC DSCResourceKit" -destinationPath . - nuget pack ".\$($env:APPVEYOR_PROJECT_NAME).nuspec" -outputdirectory . - $nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg" - $nuGetPackagePath = (Get-ChildItem $nuGetPackageName).FullName - - @( - # You can add other artifacts here - $zipFilePath, - $nuGetPackagePath - ) | % { - Write-Host "Pushing package $_ as Appveyor artifact" - Push-AppveyorArtifact $_ - } + Invoke-AppVeyorDeployTask From 2bbfe86fabe92d644d2a6bce806d4cdbf5e27b08 Mon Sep 17 00:00:00 2001 From: Michael Greene Date: Wed, 27 Feb 2019 09:58:46 -0600 Subject: [PATCH 3/4] add community maintained support statement --- ReadMe.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReadMe.md b/ReadMe.md index ea37f5e..eed5f99 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -5,6 +5,11 @@ for deployment and configuration of Windows Server Update Services. This project has adopted [this code of conduct](CODE_OF_CONDUCT.md). +## Support + +This module is community maintained as a best-effort open source project +and has no other expressed support from any individual or organization. + ## Branches ### master From 7352df97668882034b777ea22817fa45aa99b867 Mon Sep 17 00:00:00 2001 From: Michael Greene Date: Wed, 27 Feb 2019 09:59:25 -0600 Subject: [PATCH 4/4] clarify no support, best effort project --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index eed5f99..6022cb3 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -8,7 +8,7 @@ This project has adopted [this code of conduct](CODE_OF_CONDUCT.md). ## Support This module is community maintained as a best-effort open source project -and has no other expressed support from any individual or organization. +and has no expressed support from any individual or organization. ## Branches