diff --git a/.github/ISSUE_TEMPLATE/Problem_with_resource.yml b/.github/ISSUE_TEMPLATE/Problem_with_resource.yml index 02a5a21c6..9ee3687cc 100644 --- a/.github/ISSUE_TEMPLATE/Problem_with_resource.yml +++ b/.github/ISSUE_TEMPLATE/Problem_with_resource.yml @@ -74,14 +74,13 @@ body: - type: textarea id: moduleVersion attributes: - label: xWebAdministration version + label: WebAdministrationDsc version description: | - Please provide the version of the xWebAdministration module that was used. _Will be automatically formatted as plain text._ + Please provide the version of the WebAdministrationDsc module that was used. _Will be automatically formatted as plain text._ - To help with this information, please run this command: `Get-Module -Name 'xWebAdministration' -ListAvailable | ft Name,Version,Path` + To help with this information, please run this command: `Get-Module -Name 'WebAdministrationDsc' -ListAvailable | ft Name,Version,Path` placeholder: | Add module information here render: text validations: required: true - diff --git a/CHANGELOG.md b/CHANGELOG.md index ab83ccbdc..b5a0dd6dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Changelog for xWebAdministration +# Changelog for WebAdministrationDsc The format is based on and uses the types of changes according to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). @@ -7,12 +7,23 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md) ## [Unreleased] +### Changed + +- xWebAdministration + - BREAKING CHANGE + - Renamed _xWebAdministration_ to _WebAdministrationDSC_ - fixes [Issue #69](https://github.com/dsccommunity/WebAdministrationDsc/issues/213). + - Changed all MSFT_xResourceName to DSC_ResourceName. + - Updated DSCResources, Examples, Modules and Tests for new naming. + - Updated README.md from _xWebAdministration_ to _WebAdministrationDSC_ + - Removed deprecated resource `xIISHandler` + - Removed deprecated resource `xWebConfigKeyValue` + ## [3.3.0] - 2022-06-03 ### Deprecated - **The module _xWebAdministration_ will be renamed to _WebAdministrationDsc_ - ([issue #213](https://github.com/dsccommunity/xWebAdministration/issues/213)). + ([issue #213](https://github.com/dsccommunity/WebAdministrationDsc/issues/213)). The version `v3.3.0` will be the the last release of _xWebAdministration_. Version `v4.0.0` will be released as _WebAdministrationDsc_, it will be released shortly after the `v3.3.0` release to be able to start transition @@ -22,7 +33,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md) ### Changed - xWebAdministration - - Renamed `master` branch to `main` ([issue #591](https://github.com/PowerShell/xWebAdministration/issues/591)). + - Renamed `master` branch to `main` ([issue #591](https://github.com/dsccommunity/WebAdministrationDsc/issues/591)). - The pipeline will now update the module manifest property `DscResourcesToExport` automatically. - Only run the CI/CD pipeline on branch _main_ when there are changes to files @@ -50,11 +61,11 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md) ### Added -- xWebAdminstration +- xWebAdministration - Integration tests are running on more Microsoft-hosted agents to - test all possible operating systems ([issue #550](https://github.com/PowerShell/xWebAdministration/issues/550)). - - Fix a few lingering bugs in CICD ([issue #567](https://github.com/PowerShell/xWebAdministration/issues/567)) - - Remove an image from testing that MS will be deprecating soon ([issue #565](https://github.com/PowerShell/xWebAdministration/issues/567)) + test all possible operating systems ([issue #550](https://github.com/dsccommunity/WebAdministrationDsc/issues/550)). + - Fix a few lingering bugs in CICD ([issue #567](https://github.com/dsccommunity/WebAdministrationDsc/issues/567)) + - Remove an image from testing that MS will be deprecating soon ([issue #565](https://github.com/dsccommunity/WebAdministrationDsc/issues/567)) ### Changed @@ -76,16 +87,16 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md) - Updated build.yaml to use the correct values. - xWebSite - Ensure that Test-TargetResource in xWebSite tests all properties before - returning true or false, and that it uses a consistent style ([issue #221](https://github.com/PowerShell/xWebAdministration/issues/550)). + returning true or false, and that it uses a consistent style ([issue #221](https://github.com/dsccommunity/WebAdministrationDsc/issues/550)). - xIisMimeTypeMapping - Update misleading localization strings - xIisLogging - - Add Ensure to LogCustomFields. ([issue #571](https://github.com/dsccommunity/xWebAdministration/issues/571)) + - Add Ensure to LogCustomFields. ([issue #571](https://github.com/dsccommunity/WebAdministrationDsc/issues/571)) ### Fixed - WebApplicationHandler - - Integration test should no longer fail intermittent ([issue #558](https://github.com/PowerShell/xWebAdministration/issues/558)). + - Integration test should no longer fail intermittent ([issue #558](https://github.com/dsccommunity/WebAdministrationDsc/issues/558)). ## [3.1.1] - 2020-01-10 @@ -114,7 +125,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md) - xWebAdministration - Added continuous delivery with a new CI pipeline - ([issue #547](https://github.com/PowerShell/xWebAdministration/issues/547)). + ([issue #547](https://github.com/dsccommunity/WebAdministrationDsc/issues/547)). - Added CONTRIBUTION.md. ### Changed @@ -135,7 +146,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md) - WebApplicationHandler - Fix Test-TargetResource to compare only properties that are specified - in the configuration ([issue #544](https://github.com/PowerShell/xWebAdministration/issues/544)). + in the configuration ([issue #544](https://github.com/dsccommunity/WebAdministrationDsc/issues/544)). - xWebConfigProperty - In some cases a verbose message was not outputted with any text, now all verbose messages are correctly shown. diff --git a/HISTORIC_CHANGELOG.md b/HISTORIC_CHANGELOG.md index 0e568fe5b..4ae57cd80 100644 --- a/HISTORIC_CHANGELOG.md +++ b/HISTORIC_CHANGELOG.md @@ -13,91 +13,91 @@ change log short. - Adding note that entry in CHANGELOG.md is mandatory for all PRs. - Resolved custom Script Analyzer rules that was added to the test framework. - - Moved change log from README.md to a separate CHANGELOG.md ([issue #446](https://github.com/PowerShell/xWebAdministration/issues/446)). + - Moved change log from README.md to a separate CHANGELOG.md ([issue #446](https://github.com/dsccommunity/WebAdministrationDsc/issues/446)). - Remove example 'Creating the default website using configuration - data' from README.md ([issue #488](https://github.com/PowerShell/xWebAdministration/issues/488)). - - Removed examples README.md as it was obsolete ([issue #482](https://github.com/PowerShell/xWebAdministration/issues/482)). + data' from README.md ([issue #488](https://github.com/dsccommunity/WebAdministrationDsc/issues/488)). + - Removed examples README.md as it was obsolete ([issue #482](https://github.com/dsccommunity/WebAdministrationDsc/issues/482)). - Updated `Ensure` property description for `xIisHandler` resource to match schema.mof - Moved examples from Readme.md to respective `/Examples/Resources/` - folders ([issue #486](https://github.com/PowerShell/xWebAdministration/issues/486)). + folders ([issue #486](https://github.com/dsccommunity/WebAdministrationDsc/issues/486)). - Created new folder structure for examples so that examples will be - placed in `/Examples/Resources/$resourceName` ([issue #483](https://github.com/PowerShell/xWebAdministration/issues/483)). - - Added a table of contents for the resource list ([issue #450](https://github.com/PowerShell/xWebAdministration/issues/450)). - - Alphabetized the resource list in the README.md ([issue #449](https://github.com/PowerShell/xWebAdministration/issues/449)). - - Optimized exporting in the module manifest for best performance ([issue #448](https://github.com/PowerShell/xWebAdministration/issues/448)). + placed in `/Examples/Resources/$resourceName` ([issue #483](https://github.com/dsccommunity/WebAdministrationDsc/issues/483)). + - Added a table of contents for the resource list ([issue #450](https://github.com/dsccommunity/WebAdministrationDsc/issues/450)). + - Alphabetized the resource list in the README.md ([issue #449](https://github.com/dsccommunity/WebAdministrationDsc/issues/449)). + - Optimized exporting in the module manifest for best performance ([issue #448](https://github.com/dsccommunity/WebAdministrationDsc/issues/448)). - Updated hashtables in the repo to adhere to the style guidelines described at https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects - ([issue #524](https://github.com/PowerShell/xWebAdministration/issues/524)) + ([issue #524](https://github.com/dsccommunity/WebAdministrationDsc/issues/524)) - Moved example Sample_EndToEndxWebAdministration from readme.md to a - separate .ps1 in `/examples/` ([issue #491](https://github.com/PowerShell/xWebAdministration/issues/491)) + separate .ps1 in `/examples/` ([issue #491](https://github.com/dsccommunity/WebAdministrationDsc/issues/491)) - Removed example 'Create and configure an application pool' from - README.md ([issue #489](https://github.com/PowerShell/xWebAdministration/issues/489)). + README.md ([issue #489](https://github.com/dsccommunity/WebAdministrationDsc/issues/489)). - Changes to xIisHandler - - Updated schema.mof to include descriptions for each property ([issue #453](https://github.com/PowerShell/xWebAdministration/issues/453)). - - Moved MSFT_xIisHandler localization strings to strings.psd1 ([issue #463](https://github.com/PowerShell/xWebAdministration/issues/463)). + - Updated schema.mof to include descriptions for each property ([issue #453](https://github.com/dsccommunity/WebAdministrationDsc/issues/453)). + - Moved MSFT_xIisHandler localization strings to strings.psd1 ([issue #463](https://github.com/dsccommunity/WebAdministrationDsc/issues/463)). - Changes to xWebSite - Fix `Get-TargetResource` so that `LogFlags` are returned as expected array of strings (one for each flag) rather than an array containing - a single comma-separated string of flags' ([issue #332](https://github.com/PowerShell/xWebAdministration/issues/332)). - - Moved localization strings to strings.psd1 file ([issue #475](https://github.com/PowerShell/xWebAdministration/issues/475)) - - Updated schema.mof so that each property has an appropriate description ([issue #456](https://github.com/PowerShell/xWebAdministration/issues/456)). + a single comma-separated string of flags' ([issue #332](https://github.com/dsccommunity/WebAdministrationDsc/issues/332)). + - Moved localization strings to strings.psd1 file ([issue #475](https://github.com/dsccommunity/WebAdministrationDsc/issues/475)) + - Updated schema.mof so that each property has an appropriate description ([issue #456](https://github.com/dsccommunity/WebAdministrationDsc/issues/456)). - Updated schema.mof and README so that `SourceType` and `SourceName` properties for `MSFT_xLogCustomFieldInformation` are associated with - the appropriate descriptions and valuemaps/values ([issue #456](https://github.com/PowerShell/xWebAdministration/issues/456)). - - Move examples from README.md to resource examples folder ([issue #487](https://github.com/PowerShell/xWebAdministration/issues/487)). - - Fix case of resource name from `xWebsite` to `xWebSite` ([issue #535](https://github.com/PowerShell/xWebAdministration/issues/535)). + the appropriate descriptions and valuemaps/values ([issue #456](https://github.com/dsccommunity/WebAdministrationDsc/issues/456)). + - Move examples from README.md to resource examples folder ([issue #487](https://github.com/dsccommunity/WebAdministrationDsc/issues/487)). + - Fix case of resource name from `xWebsite` to `xWebSite` ([issue #535](https://github.com/dsccommunity/WebAdministrationDsc/issues/535)). - Changes to xIISLogging - Fix `Get-TargetResource` so that `LogFlags` are returned as expected array of strings (one for each flag) rather than an array containing - a single comma-separated string of flags ([issue #332](https://github.com/PowerShell/xWebAdministration/issues/332)). - - Moved MSFT_xIisLogging localization strings to strings.psd1 ([issue #464](https://github.com/PowerShell/xWebAdministration/issues/464)). + a single comma-separated string of flags ([issue #332](https://github.com/dsccommunity/WebAdministrationDsc/issues/332)). + - Moved MSFT_xIisLogging localization strings to strings.psd1 ([issue #464](https://github.com/dsccommunity/WebAdministrationDsc/issues/464)). - Changes to xSslSettings - Updated casing of `xSslSettings` in all file names, folder names, - schema, and documentation ([issue #461](https://github.com/PowerShell/xWebAdministration/issues/461)). + schema, and documentation ([issue #461](https://github.com/dsccommunity/WebAdministrationDsc/issues/461)). - Updated casing of `xSslSettings` in all file names, folder names, - schema, and documentation ([issue #536](https://github.com/PowerShell/xWebAdministration/issues/536)). - - Moved MSFT_xSslSettings localization strings to strings.psd1 ([issue #467](https://github.com/PowerShell/xWebAdministration/issues/467)). + schema, and documentation ([issue #536](https://github.com/dsccommunity/WebAdministrationDsc/issues/536)). + - Moved MSFT_xSslSettings localization strings to strings.psd1 ([issue #467](https://github.com/dsccommunity/WebAdministrationDsc/issues/467)). - Changes to xWebConfigKeyValue - - Updated schema.mof to include a description for the Ensure property ([issue #455](https://github.com/PowerShell/xWebAdministration/issues/455)). - - Move localization strings to strings.psd1 file ([issue #472](https://github.com/PowerShell/xWebAdministration/issues/472)). + - Updated schema.mof to include a description for the Ensure property ([issue #455](https://github.com/dsccommunity/WebAdministrationDsc/issues/455)). + - Move localization strings to strings.psd1 file ([issue #472](https://github.com/dsccommunity/WebAdministrationDsc/issues/472)). - Changes to xWebAppPoolDefaults - - Move localization strings to strings.psd1 file ([issue #470](https://github.com/PowerShell/xWebAdministration/issues/470)). + - Move localization strings to strings.psd1 file ([issue #470](https://github.com/dsccommunity/WebAdministrationDsc/issues/470)). - BREAKING CHANGE: Changed `ApplyTo` key parameter to `IsSingleInstance` - to bring the resource into compliance with published best practices ([issue #462](https://github.com/PowerShell/xWebAdministration/issues/462)). + to bring the resource into compliance with published best practices ([issue #462](https://github.com/dsccommunity/WebAdministrationDsc/issues/462)). - Changes to xWebApplication - - Move localization strings to strings.psd1 file ([issue #468](https://github.com/PowerShell/xWebAdministration/issues/468)) - - Add description on class MSFT_xWebApplicationAuthenticationInformation ([issue #454](https://github.com/PowerShell/xWebAdministration/issues/454)). + - Move localization strings to strings.psd1 file ([issue #468](https://github.com/dsccommunity/WebAdministrationDsc/issues/468)) + - Add description on class MSFT_xWebApplicationAuthenticationInformation ([issue #454](https://github.com/dsccommunity/WebAdministrationDsc/issues/454)). - Changes to xIisModule entry - - Moved xIisModule localization strings to strings.psd1 ([issue #466](https://github.com/PowerShell/xWebAdministration/issues/466)). + - Moved xIisModule localization strings to strings.psd1 ([issue #466](https://github.com/dsccommunity/WebAdministrationDsc/issues/466)). - Changes to xIisMimeTypeMapping - - Moved MSFT_xIisMimeTypeMapping localization strings to strings.psd1 ([issue #465](https://github.com/PowerShell/xWebAdministration/issues/465)). + - Moved MSFT_xIisMimeTypeMapping localization strings to strings.psd1 ([issue #465](https://github.com/dsccommunity/WebAdministrationDsc/issues/465)). - Changes to xWebVirtualDirectory - - Moved MSFT_xWebVirtualDirectory localization strings to strings.psd1 ([issue #477](https://github.com/PowerShell/xWebAdministration/issues/477)). + - Moved MSFT_xWebVirtualDirectory localization strings to strings.psd1 ([issue #477](https://github.com/dsccommunity/WebAdministrationDsc/issues/477)). - Changes to xWebSiteDefaults - - Move localization strings to strings.psd1 file ([issue #475](https://github.com/PowerShell/xWebAdministration/issues/475)). + - Move localization strings to strings.psd1 file ([issue #475](https://github.com/dsccommunity/WebAdministrationDsc/issues/475)). - BREAKING CHANGE: Changed `ApplyTo` key parameter to `IsSingleInstance` - to bring the resource into compliance with published best practices ([issue #457](https://github.com/PowerShell/xWebAdministration/issues/457)). - - Fix case of resource name from `xWebsiteDefaults` to `xWebSiteDefaults` ([issue #535](https://github.com/PowerShell/xWebAdministration/issues/535)). + to bring the resource into compliance with published best practices ([issue #457](https://github.com/dsccommunity/WebAdministrationDsc/issues/457)). + - Fix case of resource name from `xWebsiteDefaults` to `xWebSiteDefaults` ([issue #535](https://github.com/dsccommunity/WebAdministrationDsc/issues/535)). - Changes to xWebConfigProperty - - Move localization strings to strings.psd1 file ([issue #473](https://github.com/PowerShell/xWebAdministration/issues/473)). + - Move localization strings to strings.psd1 file ([issue #473](https://github.com/dsccommunity/WebAdministrationDsc/issues/473)). - Changes to xWebConfigPropertyCollection - - Move localization strings to strings.psd1 file ([issue #474](https://github.com/PowerShell/xWebAdministration/issues/474)). + - Move localization strings to strings.psd1 file ([issue #474](https://github.com/dsccommunity/WebAdministrationDsc/issues/474)). - Changes to xIisFeatureDelegation - - Moved MSFT_xIisFeatureDelegation localization strings to strings.psd1 ([issue #459](https://github.com/PowerShell/xWebAdministration/issues/459)). + - Moved MSFT_xIisFeatureDelegation localization strings to strings.psd1 ([issue #459](https://github.com/dsccommunity/WebAdministrationDsc/issues/459)). - Changes to xWebAppPool - - Moved MSFT_xWebAppPool localization strings to strings.psd1 ([issue #469](https://github.com/PowerShell/xWebAdministration/issues/469)). + - Moved MSFT_xWebAppPool localization strings to strings.psd1 ([issue #469](https://github.com/dsccommunity/WebAdministrationDsc/issues/469)). ## [2.8.0.0] - 2019-09-18 -- Fix multiple HTTPS bindings on one xWebsite receiving the first binding's certificate [#332](https://github.com/PowerShell/xWebAdministration/issues/332) +- Fix multiple HTTPS bindings on one xWebsite receiving the first binding's certificate [#332](https://github.com/dsccommunity/WebAdministrationDsc/issues/332) - Added unit regression test - Changes to xWebsite - Added ServerAutoStart (controls website autostart) and changed documentation for ServiceAutoStartEnabled (controls application auto-initialization). Fixes #325. - - Fix multiple HTTPS bindings on one xWebsite receiving the first binding's certificate [#332](https://github.com/PowerShell/xWebAdministration/issues/332) + - Fix multiple HTTPS bindings on one xWebsite receiving the first binding's certificate [#332](https://github.com/dsccommunity/WebAdministrationDsc/issues/332) - Added unit regression test - Changes to xWebAppPool - - Fix false `Test-TargetResource` failure for `logEventOnRecycle` if items in the Configuration property are specified in a different order than IIS natively stores them [#434](https://github.com/PowerShell/xWebAdministration/issues/434) + - Fix false `Test-TargetResource` failure for `logEventOnRecycle` if items in the Configuration property are specified in a different order than IIS natively stores them [#434](https://github.com/dsccommunity/WebAdministrationDsc/issues/434) - Changes to xIisModule - Fixed the parameters specification for the internal Get-IISHandler and Remove-IISHandler function @@ -118,7 +118,7 @@ change log short. ## [2.6.0.0] - 2019-05-15 -- Changed order of classes in schema.mof files to workaround [#423](https://github.com/PowerShell/xWebAdministration/issues/423) +- Changed order of classes in schema.mof files to workaround [#423](https://github.com/dsccommunity/WebAdministrationDsc/issues/423) - Fix subject comparison multiple entries for helper function `Find-Certificate` that could not find the test helper function `Install-NewSelfSignedCertificateExScript`. - Updated unit test for helper function `Find-Certificate` to check for multiple @@ -155,7 +155,7 @@ change log short. ## [2.1.0.0] - 2018-07-25 - Added new resources **xWebConfigProperty** and **xWebConfigPropertyCollection** extending functionality provided by **xWebConfigKeyValue**, addresses #249. -- Fixed Get-DscConfiguration throw in xWebSite; addresses [#372](https://github.com/PowerShell/xWebAdministration/issues/372). [Reggie Gibson (@regedit32)](https://github.com/regedit32) +- Fixed Get-DscConfiguration throw in xWebSite; addresses [#372](https://github.com/dsccommunity/WebAdministrationDsc/issues/372). [Reggie Gibson (@regedit32)](https://github.com/regedit32) - Added **WebApplicationHandler** resource for creating and modifying IIS Web Handlers. Fixes #337 - Added **WebApplicationHandler** integration tests - Added **WebApplicationHandler** unit tests @@ -168,7 +168,7 @@ change log short. - Updated **xWebSite** to include ability to manage custom logging fields. [Reggie Gibson (@regedit32)](https://github.com/regedit32) - Updated **xIISLogging** to include ability to manage custom logging fields - ([issue #267](https://github.com/PowerShell/xWebAdministration/issues/267)). + ([issue #267](https://github.com/dsccommunity/WebAdministrationDsc/issues/267)). [@ldillonel](https://github.com/ldillonel) - BREAKING CHANGE: Updated **xIisFeatureDelegation** to be able to manage any configuration section. diff --git a/README.md b/README.md index 42bc426b4..007e1ad31 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ -# xWebAdministration +# WebAdministrationDsc -This module contains DSC resources for the management and -configuration of Microsoft Internet Information Services (IIS). +This module contains DSC resources for the management and configuration of Microsoft Internet Information Services (IIS). -[![Build Status](https://dev.azure.com/dsccommunity/xWebAdministration/_apis/build/status/dsccommunity.xWebAdministration?branchName=main)](https://dev.azure.com/dsccommunity/xWebAdministration/_build/latest?definitionId=7&branchName=main) -![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/dsccommunity/xWebAdministration/7/main) -[![codecov](https://codecov.io/gh/dsccommunity/xWebAdministration/branch/main/graph/badge.svg)](https://codecov.io/gh/dsccommunity/xWebAdministration) -[![Azure DevOps tests](https://img.shields.io/azure-devops/tests/dsccommunity/xWebAdministration/7/main)](https://dsccommunity.visualstudio.com/xWebAdministration/_test/analytics?definitionId=7&contextType=build) -[![PowerShell Gallery (with prereleases)](https://img.shields.io/powershellgallery/vpre/xWebAdministration?label=xWebAdministration%20Preview)](https://www.powershellgallery.com/packages/xWebAdministration/) -[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/xWebAdministration?label=xWebAdministration)](https://www.powershellgallery.com/packages/xWebAdministration/) +[![Build Status](https://dev.azure.com/dsccommunity/WebAdministrationDsc/_apis/build/status/dsccommunity.WebAdministrationDsc?branchName=main)](https://dev.azure.com/dsccommunity/WebAdministrationDsc/_build/latest?definitionId=7&branchName=main) +![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/dsccommunity/WebAdministrationDsc/7/main) +[![Azure DevOps tests](https://img.shields.io/azure-devops/tests/dsccommunity/WebAdministrationDsc/7/main)](https://dsccommunity.visualstudio.com/WebAdministrationDsc/_test/analytics?definitionId=7&contextType=build) +[![codecov](https://codecov.io/gh/dsccommunity/WebAdministrationDsc/branch/main/graph/badge.svg)](https://codecov.io/gh/dsccommunity/WebAdministrationDsc) +[![PowerShell Gallery (with prereleases)](https://img.shields.io/powershellgallery/vpre/WebAdministrationDsc?label=WebAdministrationDsc%20Preview)](https://www.powershellgallery.com/packages/WebAdministrationDsc/) +[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/WebAdministrationDsc?label=WebAdministrationDsc)](https://www.powershellgallery.com/packages/WebAdministrationDsc/) ## Code of Conduct @@ -31,16 +30,16 @@ A full list of changes in each version can be found in the [change log](CHANGELO ## Documentation -The documentation can be found in the [xWebAdministration Wiki](https://github.com/dsccommunity/xWebAdministration/wiki). +The documentation can be found in the [WebAdministration Wiki](https://github.com/dsccommunity/WebAdministration/wiki). The DSC resources schema files is used to automatically update the documentation on each PR merge. ### Examples -You can review the [Examples](/source/Examples) directory in the xWebAdministration module +You can review the [Examples](/source/Examples) directory in the WebAdministration module for some general use scenarios for all of the resources that are in the module. -The resource examples are also available in the [xWebAdministration Wiki](https://github.com/dsccommunity/xWebAdministration/wiki). +The resource examples are also available in the [WebAdministration Wiki](https://github.com/dsccommunity/WebAdministration/wiki). ## Installation @@ -55,14 +54,14 @@ To install from the PowerShell gallery using PowerShellGet (in PowerShell 5.0) run the following command: ```powershell -Find-Module -Name xWebAdministration | Install-Module +Find-Module -Name WebAdministrationDsc | Install-Module ``` To confirm installation, run the below command and ensure you see the DSC resources available: ```powershell -Get-DscResource -Module xWebAdministration +Get-DscResource -Module WebAdministrationDsc ``` ## Requirements @@ -75,28 +74,26 @@ The minimum Windows Management Framework (PowerShell) version required is ## Examples -You can review the [Examples](/source/Examples) directory in the xWebAdministration +You can review the [Examples](/source/Examples) directory in the WebAdministrationDsc module for some general use scenarios for all of the resources that are in the module. ## Resources * [WebApplicationHandler](#webapplicationhandler) -* [xIisFeatureDelegation](#xiisfeaturedelegation) -* [xIISLogging](#xiislogging) -* [xIisHandler (DEPRECATED)](#xiishandler-deprecated) -* [xIisMimeTypeMapping](#xiismimetypemapping) -* [xIISModule](#xiismodule) -* [xSslSettings](#xsslsettings) -* [xWebApplication](#xwebapplication) -* [xWebAppPool](#xwebapppool) -* [xWebAppPoolDefaults](#xwebapppooldefaults) -* [xWebConfigKeyValue (DEPRECATED)](#xwebconfigkeyvalue-deprecated) -* [xWebConfigProperty](#xwebconfigproperty) -* [xWebConfigPropertyCollection](#xwebconfigpropertycollection) -* [xWebSite](#xwebsite) -* [xWebSiteDefaults](#xwebsitedefaults) -* [xWebVirtualDirectory](#xwebvirtualdirectory) +* [IisFeatureDelegation](#iisfeaturedelegation) +* [IISLogging](#iislogging) +* [IisMimeTypeMapping](#iismimetypemapping) +* [IisModule](#IisModule) +* [SslSettings](#sslsettings) +* [WebApplication](#webapplication) +* [WebAppPool](#webapppool) +* [WebAppPoolDefaults](#webapppooldefaults) +* [WebConfigProperty](#webconfigproperty) +* [WebConfigPropertyCollection](#webconfigpropertycollection) +* [WebSite](#website) +* [WebSiteDefaults](#websitedefaults) +* [WebVirtualDirectory](#webvirtualdirectory) ### WebApplicationHandler @@ -117,7 +114,7 @@ the module. handler processes the full path, contoso/marketing/imageGallery. If the value is false, the handler processes only the last section of the path, /imageGallery. * **[UInt64] ResponseBufferLimit** _(Write)_: Specifies the maximum size, in bytes, of the response buffer for a request handler runs. -### xIisFeatureDelegation +### IisFeatureDelegation This resource manages the IIS configuration section locking (overrideMode) to control what configuration can be set in web.config. @@ -125,16 +122,9 @@ This resource manages the IIS configuration section locking (overrideMode) to co * **OverrideMode**: Mode of that section { **Allow** | **Deny** } * **Path**: Specifies the configuration path. This can be either an IIS configuration path in the format computer machine/webroot/apphost, or the IIS module path in this format IIS:\sites\Default Web Site. *WARNING: both path types can be used to manage the same feature delegation, however, there is no way to control if two resources in the configuration set the same feature delegation*. -### xIisHandler (DEPRECATED) +### IISLogging -> Please use WebApplicationHandler resource instead. xIISHandler will be removed in future release - -* **Name**: The name of the handler, for example **PageHandlerFactory-Integrated-4.0** -* **Ensure**: Ensures that the handler is **Present** or **Absent**. Defaults to **Present**. - -### xIISLogging - -**Note** This will set the logfile settings for **all** websites; for individual websites use the Log options under **xWebSite** +**Note** This will set the logfile settings for **all** websites; for individual websites use the Log options under **WebSite** * **LogPath**: The directory to be used for logfiles. * **LogFlags**: The W3C logging fields: The values that are allowed for this property are: `Date`,`Time`,`ClientIP`,`UserName`,`SiteName`,`ComputerName`,`ServerIP`,`Method`,`UriStem`,`UriQuery`,`HttpStatus`,`Win32Status`,`BytesSent`,`BytesRecv`,`TimeTaken`,`ServerPort`,`UserAgent`,`Cookie`,`Referer`,`ProtocolVersion`,`Host`,`HttpSubStatus` @@ -143,18 +133,18 @@ This resource manages the IIS configuration section locking (overrideMode) to co * **LoglocalTimeRollover**: Use the localtime for file naming and rollover. The acceptable values for this property are: `$true`, `$false` * **LogFormat**: Format of the Logfiles. **Note**Only W3C supports LogFlags. The acceptable values for this property are: `IIS`,`W3C`,`NCSA` * **LogTargetW3C**: Log Target of the W3C Logfiles. The acceptable values for this property are: `File`,`ETW`,`File,ETW` -* **LogCustomFields**: Custom logging field information the form of an array of embedded instances of the **MSFT_xLogCustomField** CIM class that implements the following properties: +* **LogCustomFields**: Custom logging field information the form of an array of embedded instances of the **DSC_LogCustomField** CIM class that implements the following properties: * **LogFieldName**: Field name to identify the custom field within the log file. Please note that the field name cannot contain spaces. * **SourceType**: You can select `RequestHeader`, `ResponseHeader`, or `ServerVariable` (note that enhanced logging cannot log a server variable with a name that contains lower-case characters - to include a server variable in the event log just make sure that its name consists of all upper-case characters). * **SourceName**: Name of the HTTP header or server variable (depending on the Source Type you selected) that contains a value that you want to log. -### xIisMimeTypeMapping +### IisMimeTypeMapping * **Extension**: The file extension to map such as **.html** or **.xml** * **MimeType**: The MIME type to map that extension to such as **text/html** * **Ensure**: Ensures that the MIME type mapping is **Present** or **Absent**. -### xIISModule +### IisModule * **Path**: The path to the module to be registered. * **Name**: The logical name to register the module as in IIS. @@ -164,13 +154,13 @@ This resource manages the IIS configuration section locking (overrideMode) to co * **ModuleType**: The type of the module. Currently, only FastCgiModule is supported. * **Ensure**: Ensures that the module is **Present** or **Absent**. -### xSslSettings +### SslSettings * **Name**: The Name of website in which to modify the SSL Settings * **Bindings**: The SSL bindings to implement. * **Ensure**: Ensures if the bindings are **Present** or **Absent**. -### xWebApplication +### WebApplication * **Website**: Name of website with which the web application is associated. * **Name**: The desired name of the web application. @@ -181,7 +171,7 @@ This resource manages the IIS configuration section locking (overrideMode) to co * **ServiceAutoStartEnabled**: When set to `$true` this will enable Autostart on a Website * **ServiceAutoStartProvider**: Adds a AutostartProvider * **ApplicationType**: Adds a AutostartProvider ApplicationType -* **AuthenticationInformation**: Web Application's authentication information in the form of an array of embedded instances of the **MSFT_xWebApplicationAuthenticationInformation** CIM class. **MSFT_xWebApplicationAuthenticationInformation** take the following properties: +* **AuthenticationInformation**: Web Application's authentication information in the form of an array of embedded instances of the **DSC_WebApplicationAuthenticationInformation** CIM class. **DSC_WebApplicationAuthenticationInformation** take the following properties: * **Anonymous**: The acceptable values for this property are: `$true`, `$false` * **Basic**: The acceptable values for this property are: `$true`, `$false` * **Digest**: The acceptable values for this property are: `$true`, `$false` @@ -189,7 +179,7 @@ This resource manages the IIS configuration section locking (overrideMode) to co * **SslFlags**: SslFlags for the application: The acceptable values for this property are: `''`, `Ssl`, `SslNegotiateCert`, `SslRequireCert`, `Ssl128` * **EnabledProtocols**: EnabledProtocols for the application. The acceptable values for this property are: `http`, `https`, `net.tcp`, `net.msmq`, `net.pipe` -### xWebAppPool +### WebAppPool * **Name** : Indicates the application pool name. The value must contain between `1` and `64` characters. * **Ensure** : Indicates if the application pool exists. Set this property to `Absent` to ensure that the application pool does not exist. @@ -280,25 +270,13 @@ This resource manages the IIS configuration section locking (overrideMode) to co TimeSpan values must be between `00:00:00` and `23:59:59` seconds inclusive, with a granularity of 60 seconds. Setting the value of this property to `""` disables the schedule. -### xWebAppPoolDefaults +### WebAppPoolDefaults * **IsSingleInstance**: Specifies the resource is a single instance, the value must be **Yes** * **ManagedRuntimeVersion**: CLR Version {v2.0|v4.0|} empty string for unmanaged. * **ApplicationPoolIdentity**: {ApplicationPoolIdentity | LocalService | LocalSystem | NetworkService} -### xWebConfigKeyValue (DEPRECATED) - ->NOTE: The **xWebConfigKeyValue** resource is deprecated and has been replaced by the **xWebConfigProperty** and **xWebConfigPropertyCollection** resources. ->It may be removed in a future release. - -* **WebsitePath**: Path to website location (IIS or WebAdministration format). -* **ConfigSection**: Section to update (only AppSettings supported as of now). -* **Key**: Key for AppSettings. -* **Value**: Value for AppSettings. -* **Ensure**: Ensures if the appSetting is **Present** or **Absent**. -* **IsAttribute**: If the given key value pair is for attribute, default is element. - -### xWebConfigProperty +### WebConfigProperty Ensures the value of an identified property in the web.config file. @@ -308,9 +286,9 @@ Ensures the value of an identified property in the web.config file. * **Value**: Value of the property to update. * **Ensure**: Indicates if the property and value should be present or absent. Defaults to 'Present'. { *Present* | Absent } -### xWebConfigPropertyCollection +### WebConfigPropertyCollection -Ensures the value of an identified property collection item's property in the web.config file. Builds upon the **xWebConfigKeyValue** resource to support all web.config elements that contain collections of child items. +Ensures the value of an identified property collection item's property in the web.config file. Supports all web.config elements that contain collections of child items. * **WebsitePath**: Path to website location (IIS or WebAdministration format). * **Filter**: Filter used to locate property collection to update. @@ -322,13 +300,13 @@ Ensures the value of an identified property collection item's property in the we * **ItemPropertyValue**: Value of the property of the property collection item to update. * **Ensure**: Indicates if the property and value should be present or absent. Defaults to 'Present'. { *Present* | Absent } -### xWebSite +### WebSite * **Name** : The desired name of the website. * **SiteId** : Optional. The desired IIS site Id for the website. * **PhysicalPath**: The path to the files that compose the website. * **State**: The state of the website: { Started | Stopped } -* **BindingInfo**: Website's binding information in the form of an array of embedded instances of the **MSFT_xWebBindingInformation** CIM class that implements the following properties: +* **BindingInfo**: Website's binding information in the form of an array of embedded instances of the **DSC_WebBindingInformation** CIM class that implements the following properties: * **Protocol**: The protocol of the binding. This property is required. The acceptable values for this property are: `http`, `https`, `msmq.formatname`, `net.msmq`, `net.pipe`, `net.tcp`. * **BindingInformation**: The binding information in the form a colon-delimited string that includes the IP address, port, and host name of the binding. This property is ignored for `http` and `https` bindings if at least one of the following properties is specified: **IPAddress**, **Port**, **HostName**. * **IPAddress**: The IP address of the binding. This property is only applicable for `http` and `https` bindings. The default value is `*`. @@ -351,8 +329,8 @@ Ensures the value of an identified property collection item's property in the we * **ServiceAutoStartEnabled**: When set to `$true` this will enable application Autostart (application initalization without an initial request) on a Website * **ServiceAutoStartProvider**: Adds a AutostartProvider * **ApplicationType**: Adds a AutostartProvider ApplicationType -* **AuthenticationInfo**: Website's authentication information in the form of an embedded instance of the **MSFT_xWebAuthenticationInformation** CIM class. -**MSFT_xWebAuthenticationInformation** takes the following properties: +* **AuthenticationInfo**: Website's authentication information in the form of an embedded instance of the **DSC_WebAuthenticationInformation** CIM class. +**DSC_WebAuthenticationInformation** takes the following properties: * **Anonymous**: The acceptable values for this property are: `$true`, `$false` * **Basic**: The acceptable values for this property are: `$true`, `$false` * **Digest**: The acceptable values for this property are: `$true`, `$false` @@ -364,12 +342,12 @@ Ensures the value of an identified property collection item's property in the we * **LogTruncateSize**: How large the file should be before it is truncated. If this is set then LogPeriod will be ignored if passed in and set to MaxSize. The value must be a valid integer between `1048576 (1MB)` and `4294967295 (4GB)`. * **LoglocalTimeRollover**: Use the localtime for file naming and rollover. The acceptable values for this property are: `$true`, `$false` * **LogFormat**: Format of the Logfiles. **Note**Only W3C supports LogFlags. The acceptable values for this property are: `IIS`,`W3C`,`NCSA` -* **LogCustomFields**: Custom logging field information the form of an array of embedded instances of the **MSFT_xLogCustomFieldInformation** CIM class that implements the following properties: +* **LogCustomFields**: Custom logging field information the form of an array of embedded instances of the **DSC_LogCustomFieldInformation** CIM class that implements the following properties: * **LogFieldName**: Field name to identify the custom field within the log file. Please note that the field name cannot contain spaces. * **SourceType**: The acceptable values for this property are: `RequestHeader`, `ResponseHeader`, or `ServerVariable` (note that enhanced logging cannot log a server variable with a name that contains lower-case characters - to include a server variable in the event log just make sure that its name consists of all upper-case characters). * **SourceName**: Name of the HTTP header or server variable (depending on the Source Type you selected) that contains a value that you want to log. -### xWebSiteDefaults +### WebSiteDefaults * **Key**: Required Key value, always **Machine** * **LogFormat**: Format of the Logfiles. **Note**Only W3C supports LogFlags. The acceptable values for this property are: `IIS`,`W3C`,`NCSA`,`Custom`. @@ -378,7 +356,7 @@ Ensures the value of an identified property collection item's property in the we * **DefaultApplicationPool**: Name of the default application pool used by websites. * **AllowSubDirConfig**: Should IIS look for config files in subdirectories, either **true** or **false** -### xWebVirtualDirectory +### WebVirtualDirectory * **Website**: Name of website with which virtual directory is associated * **WebApplication**: The name of the containing web application or an empty string for the containing website @@ -386,19 +364,7 @@ Ensures the value of an identified property collection item's property in the we * **Name**: The name of the virtual directory * **Ensure**: Ensures if the virtual directory is **Present** or **Absent**. -### xWebConfigKeyValue (DEPRECATED) - ->NOTE: The **xWebConfigKeyValue** resource is deprecated and has been replaced by the **xWebConfigProperty** and **xWebConfigPropertyCollection** resources. ->It may be removed in a future release. - -* **WebsitePath**: Path to website location (IIS or WebAdministration format). -* **ConfigSection**: Section to update (only AppSettings supported as of now). -* **Key**: Key for AppSettings. -* **Value**: Value for AppSettings. -* **Ensure**: Ensures if the appSetting is **Present** or **Absent**. -* **IsAttribute**: If the given key value pair is for attribute, default is element. - -### xWebConfigProperty +### WebConfigProperty Ensures the value of an identified property in the web.config file. @@ -408,9 +374,9 @@ Ensures the value of an identified property in the web.config file. * **Value**: Value of the property to update. * **Ensure**: Indicates if the property and value should be present or absent. Defaults to 'Present'. { *Present* | Absent } -### xWebConfigPropertyCollection +### WebConfigPropertyCollection -Ensures the value of an identified property collection item's property in the web.config file. Builds upon the **xWebConfigKeyValue** resource to support all web.config elements that contain collections of child items. +Ensures the value of an identified property collection item's property in the web.config file. Builds upon the **WebConfigKeyValue** resource to support all web.config elements that contain collections of child items. * **WebsitePath**: Path to website location (IIS or WebAdministration format). * **Filter**: Filter used to locate property collection to update. @@ -422,13 +388,13 @@ Ensures the value of an identified property collection item's property in the we * **ItemPropertyValue**: Value of the property of the property collection item to update. * **Ensure**: Indicates if the property and value should be present or absent. Defaults to 'Present'. { *Present* | Absent } -### xSslSettings +### SslSettings * **Name**: The Name of website in which to modify the SSL Settings * **Bindings**: The SSL bindings to implement. * **Ensure**: Ensures if the bindings are **Present** or **Absent**. -### xIisFeatureDelegation +### IisFeatureDelegation This resource manages the IIS configuration section locking (overrideMode) to control what configuration can be set in web.config. @@ -436,19 +402,19 @@ This resource manages the IIS configuration section locking (overrideMode) to co * **OverrideMode**: Mode of that section { **Allow** | **Deny** } * **Path**: Specifies the configuration path. This can be either an IIS configuration path in the format computer machine/webroot/apphost, or the IIS module path in this format IIS:\sites\Default Web Site. *WARNING: both path types can be used to manage the same feature delegation, however, there is no way to control if two resources in the configuration set the same feature delegation*. -### xIisMimeTypeMapping +### IisMimeTypeMapping * **Extension**: The file extension to map such as **.html** or **.xml** * **MimeType**: The MIME type to map that extension to such as **text/html** * **Ensure**: Ensures that the MIME type mapping is **Present** or **Absent**. -### xWebAppPoolDefaults +### WebAppPoolDefaults * **IsSingleInstance**: Specifies the resource is a single instance, the value must be **Yes** * **ManagedRuntimeVersion**: CLR Version {v2.0|v4.0|} empty string for unmanaged. * **ApplicationPoolIdentity**: {ApplicationPoolIdentity | LocalService | LocalSystem | NetworkService} -### xWebSiteDefaults +### WebSiteDefaults * **Key**: Required Key value, always **Machine** * **LogFormat**: Format of the Logfiles. **Note**Only W3C supports LogFlags. The acceptable values for this property are: `IIS`,`W3C`,`NCSA`,`Custom`. @@ -567,7 +533,7 @@ configuration xPhp } # Make sure the php cgi module is registered with IIS - xIisModule phpHandler + IisModule phpHandler { Name = "phpFastCgi" Path = "$($DestinationPath)\php-cgi.exe" diff --git a/RequiredModules.psd1 b/RequiredModules.psd1 index b55e6d39d..b34b9b41c 100644 --- a/RequiredModules.psd1 +++ b/RequiredModules.psd1 @@ -21,4 +21,5 @@ xDscResourceDesigner = 'latest' 'DscResource.DocGenerator' = 'latest' PSPKI = 'latest' + 'DscResource.Common' = 'latest' } diff --git a/build.yaml b/build.yaml index ee0d286a5..4b63dc248 100644 --- a/build.yaml +++ b/build.yaml @@ -10,6 +10,17 @@ CopyPaths: Encoding: UTF8 VersionedOutputDirectory: true +#################################################### +# ModuleBuilder Dependent Modules Configuration # +#################################################### + +NestedModule: + DscResource.Common: + CopyOnly: true + Path: ./output/RequiredModules/DscResource.Common + AddToManifest: false + Exclude: PSGetModuleInfo.xml + #################################################### # Sampler Pipeline Configuration # #################################################### @@ -51,6 +62,7 @@ BuildWorkflow: Pester: OutputFormat: NUnitXML ExcludeFromCodeCoverage: + - Modules/DscResource.Common Script: - tests/Unit Tag: @@ -65,6 +77,7 @@ DscTest: ExcludeSourceFile: - output ExcludeModuleFile: + - Modules/DscResource.Common MainGitBranch: main ModuleBuildTasks: Sampler: diff --git a/codecov.yml b/codecov.yml index 4489cf250..b2b555c56 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,6 +1,6 @@ codecov: require_ci_to_pass: no - # master should be the baseline for reporting + # main should be the baseline for reporting branch: main comment: @@ -32,4 +32,3 @@ fixes: # example a deprecated function where tests has been removed. #ignore: # - 'source/Public/Get-Deprecated.ps1' - diff --git a/source/DSCResources/MSFT_xIisFeatureDelegation/MSFT_xIisFeatureDelegation.psm1 b/source/DSCResources/DSC_IisFeatureDelegation/DSC_IisFeatureDelegation.psm1 similarity index 90% rename from source/DSCResources/MSFT_xIisFeatureDelegation/MSFT_xIisFeatureDelegation.psm1 rename to source/DSCResources/DSC_IisFeatureDelegation/DSC_IisFeatureDelegation.psm1 index 19de8845b..e7c2ee9c7 100644 --- a/source/DSCResources/MSFT_xIisFeatureDelegation/MSFT_xIisFeatureDelegation.psm1 +++ b/source/DSCResources/DSC_IisFeatureDelegation/DSC_IisFeatureDelegation.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xIisFeatureDelegation' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSIS @@ -176,7 +179,7 @@ function Get-OverrideMode $Path ) - Assert-Module + Assert-Module -ModuleName WebAdministration Write-Verbose -Message ( $script:localizedData.GetOverrideMode -f $Filter ) diff --git a/source/DSCResources/MSFT_xIisFeatureDelegation/MSFT_xIisFeatureDelegation.schema.mof b/source/DSCResources/DSC_IisFeatureDelegation/DSC_IisFeatureDelegation.schema.mof similarity index 81% rename from source/DSCResources/MSFT_xIisFeatureDelegation/MSFT_xIisFeatureDelegation.schema.mof rename to source/DSCResources/DSC_IisFeatureDelegation/DSC_IisFeatureDelegation.schema.mof index 61112154c..1bcf94b61 100644 --- a/source/DSCResources/MSFT_xIisFeatureDelegation/MSFT_xIisFeatureDelegation.schema.mof +++ b/source/DSCResources/DSC_IisFeatureDelegation/DSC_IisFeatureDelegation.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("1.0.0"), FriendlyName("xIisFeatureDelegation")] -class MSFT_xIisFeatureDelegation : OMI_BaseResource +[ClassVersion("1.0.0"), FriendlyName("IisFeatureDelegation")] +class DSC_IisFeatureDelegation : OMI_BaseResource { [Key, Description("Specifies the configuration path. This can be either an IIS configuration path in the format computer machine/webroot/apphost, or the IIS module path in this format IIS:\\sites\\Default Web Site.")] String Path; [Key, Description("Specifies the IIS configuration section to lock or unlock.")] String Filter; diff --git a/source/DSCResources/MSFT_xIisFeatureDelegation/README.md b/source/DSCResources/DSC_IisFeatureDelegation/README.md similarity index 57% rename from source/DSCResources/MSFT_xIisFeatureDelegation/README.md rename to source/DSCResources/DSC_IisFeatureDelegation/README.md index f2dc0af63..f0724d78a 100644 --- a/source/DSCResources/MSFT_xIisFeatureDelegation/README.md +++ b/source/DSCResources/DSC_IisFeatureDelegation/README.md @@ -1,6 +1,6 @@ # Description -The `xIisFeatureDelegation` DSC resource is used to manage the IIS configuration +The `IisFeatureDelegation` DSC resource is used to manage the IIS configuration section locking (overrideMode) to control what configuration can be set in web.config. ## Requirements @@ -9,4 +9,4 @@ section locking (overrideMode) to control what configuration can be set in web.c ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xIisFeatureDelegation). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministrationDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+IisFeatureDelegation). diff --git a/source/DSCResources/MSFT_xIisFeatureDelegation/en-US/MSFT_xIisFeatureDelegation.strings.psd1 b/source/DSCResources/DSC_IisFeatureDelegation/en-US/DSC_IisFeatureDelegation.strings.psd1 similarity index 84% rename from source/DSCResources/MSFT_xIisFeatureDelegation/en-US/MSFT_xIisFeatureDelegation.strings.psd1 rename to source/DSCResources/DSC_IisFeatureDelegation/en-US/DSC_IisFeatureDelegation.strings.psd1 index 92390ed70..a50bcef18 100644 --- a/source/DSCResources/MSFT_xIisFeatureDelegation/en-US/MSFT_xIisFeatureDelegation.strings.psd1 +++ b/source/DSCResources/DSC_IisFeatureDelegation/en-US/DSC_IisFeatureDelegation.strings.psd1 @@ -1,4 +1,4 @@ -# Localized resources for MSFT_xIisFeatureDelegation +# Localized resources for DSC_IisFeatureDelegation ConvertFrom-StringData @' GetOverrideMode = Getting override mode for '{0}'. diff --git a/source/DSCResources/MSFT_xIisLogging/MSFT_xIisLogging.psm1 b/source/DSCResources/DSC_IisLogging/DSC_IisLogging.psm1 similarity index 96% rename from source/DSCResources/MSFT_xIisLogging/MSFT_xIisLogging.psm1 rename to source/DSCResources/DSC_IisLogging/DSC_IisLogging.psm1 index 0f586c347..fb7091672 100644 --- a/source/DSCResources/MSFT_xIisLogging/MSFT_xIisLogging.psm1 +++ b/source/DSCResources/DSC_IisLogging/DSC_IisLogging.psm1 @@ -1,12 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) -# Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xIisLogging' +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') +# Import Localization Strings +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSIS This will return a hashtable of results about the given LogPath @@ -21,7 +23,7 @@ function Get-TargetResource [String] $LogPath ) - Assert-Module + Assert-Module -ModuleName WebAdministration $currentLogSettings = Get-WebConfiguration ` -filter '/system.applicationHost/sites/siteDefaults/Logfile' @@ -120,7 +122,7 @@ function Set-TargetResource $LogCustomFields ) - Assert-Module + Assert-Module -ModuleName WebAdministration $currentLogState = Get-TargetResource -LogPath $LogPath @@ -288,7 +290,7 @@ function Test-TargetResource $LogCustomFields ) - Assert-Module + Assert-Module -ModuleName WebAdministration $currentLogState = Get-TargetResource -LogPath $LogPath @@ -422,7 +424,7 @@ function Compare-LogFlags } <# .SYNOPSIS - Converts IIS custom log field collection to instances of the MSFT_xLogCustomField CIM class. + Converts IIS custom log field collection to instances of the DSC_LogCustomField CIM class. .PARAMETER InputObject Specifies input object passed in @@ -441,7 +443,7 @@ function ConvertTo-CimLogCustomFields [Object[]] $InputObject ) - $cimClassName = 'MSFT_xLogCustomField' + $cimClassName = 'DSC_LogCustomField' $cimNamespace = 'root/microsoft/Windows/DesiredStateConfiguration' $cimCollection = New-Object -TypeName 'System.Collections.ObjectModel.Collection`1[Microsoft.Management.Infrastructure.CimInstance]' diff --git a/source/DSCResources/MSFT_xIisLogging/MSFT_xIisLogging.schema.mof b/source/DSCResources/DSC_IisLogging/DSC_IisLogging.schema.mof similarity index 85% rename from source/DSCResources/MSFT_xIisLogging/MSFT_xIisLogging.schema.mof rename to source/DSCResources/DSC_IisLogging/DSC_IisLogging.schema.mof index f809a47ca..e01eeeec6 100644 --- a/source/DSCResources/MSFT_xIisLogging/MSFT_xIisLogging.schema.mof +++ b/source/DSCResources/DSC_IisLogging/DSC_IisLogging.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("1.0.0"), FriendlyName("xIisLogging")] -class MSFT_xIisLogging : OMI_BaseResource +[ClassVersion("1.0.0"), FriendlyName("IisLogging")] +class DSC_IisLogging : OMI_BaseResource { [Key, Description ("The directory to be used for logfiles")] String LogPath; [Write, Description ("The W3C logging fields"), ValueMap{"Date","Time","ClientIP","UserName","SiteName","ComputerName","ServerIP","Method","UriStem","UriQuery","HttpStatus","Win32Status","BytesSent","BytesRecv","TimeTaken","ServerPort","UserAgent","Cookie","Referer","ProtocolVersion","Host","HttpSubStatus"}, Values{"Date","Time","ClientIP","UserName","SiteName","ComputerName","ServerIP","Method","UriStem","UriQuery","HttpStatus","Win32Status","BytesSent","BytesRecv","TimeTaken","ServerPort","UserAgent","Cookie","Referer","ProtocolVersion","Host","HttpSubStatus"}] String LogFlags[]; @@ -8,11 +8,11 @@ class MSFT_xIisLogging : OMI_BaseResource [Write, Description ("Use the localtime for file naming and rollover")] Boolean LoglocalTimeRollover; [Write, Description ("Format of the Logfiles. Only W3C supports LogFlags"), ValueMap{"IIS","W3C","NCSA"}, Values{"IIS","W3C","NCSA"}] String LogFormat; [Write, Description ("Specifies whether IIS will use Event Tracing or file logging"), ValueMap{"File","ETW","File,ETW"}, Values{"File","ETW","File,ETW"}] String LogTargetW3C; - [Write, EmbeddedInstance("MSFT_xLogCustomField"), Description("Custom logging field information in the form of an array of embedded instances of MSFT_xLogCustomField CIM class")] String LogCustomFields[]; + [Write, EmbeddedInstance("DSC_LogCustomField"), Description("Custom logging field information in the form of an array of embedded instances of DSC_LogCustomField CIM class")] String LogCustomFields[]; }; [ClassVersion("1.0.0")] -class MSFT_xLogCustomField +class DSC_LogCustomField { [Required, Description("Name for the custom field")] String LogFieldName; [Required, Description("Name for the source type")] String SourceName; diff --git a/source/DSCResources/MSFT_xIisLogging/README.md b/source/DSCResources/DSC_IisLogging/README.md similarity index 58% rename from source/DSCResources/MSFT_xIisLogging/README.md rename to source/DSCResources/DSC_IisLogging/README.md index 556db556b..c7c3283f0 100644 --- a/source/DSCResources/MSFT_xIisLogging/README.md +++ b/source/DSCResources/DSC_IisLogging/README.md @@ -1,6 +1,6 @@ # Description -The `xIISLogging` DSC resource is used to set the logfile settings for **all** +The `IisLogging` DSC resource is used to set the logfile settings for **all** websites; for individual websites use the Log options under **xWebSite**. ## Requirements @@ -9,4 +9,4 @@ websites; for individual websites use the Log options under **xWebSite**. ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xIISLogging). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministrationDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+IisLogging). diff --git a/source/DSCResources/MSFT_xIisLogging/en-US/MSFT_xIisLogging.strings.psd1 b/source/DSCResources/DSC_IisLogging/en-US/DSC_IisLogging.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xIisLogging/en-US/MSFT_xIisLogging.strings.psd1 rename to source/DSCResources/DSC_IisLogging/en-US/DSC_IisLogging.strings.psd1 diff --git a/source/DSCResources/MSFT_xIisMimeTypeMapping/MSFT_xIisMimeTypeMapping.psm1 b/source/DSCResources/DSC_IisMimeTypeMapping/DSC_IisMimeTypeMapping.psm1 similarity index 91% rename from source/DSCResources/MSFT_xIisMimeTypeMapping/MSFT_xIisMimeTypeMapping.psm1 rename to source/DSCResources/DSC_IisMimeTypeMapping/DSC_IisMimeTypeMapping.psm1 index 28252ae4b..ea4208138 100644 --- a/source/DSCResources/MSFT_xIisMimeTypeMapping/MSFT_xIisMimeTypeMapping.psm1 +++ b/source/DSCResources/DSC_IisMimeTypeMapping/DSC_IisMimeTypeMapping.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xIisMimeTypeMapping' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' Set-Variable ConstDefaultConfigurationPath -Option Constant -Value 'MACHINE/WEBROOT/APPHOST' -Scope Script Set-Variable ConstSectionNode -Option Constant -Value 'system.webServer/staticContent' -Scope Script @@ -52,7 +55,7 @@ function Get-TargetResource ) # Check if WebAdministration module is present for IIS cmdlets - Assert-Module + Assert-Module -ModuleName WebAdministration if (!$ConfigurationPath) { @@ -123,7 +126,7 @@ function Set-TargetResource $Ensure ) - Assert-Module + Assert-Module -ModuleName WebAdministration if (!$ConfigurationPath) { @@ -197,7 +200,7 @@ function Test-TargetResource $Ensure ) - Assert-Module + Assert-Module -ModuleName WebAdministration if (!$ConfigurationPath) { diff --git a/source/DSCResources/MSFT_xIisMimeTypeMapping/MSFT_xIisMimeTypeMapping.schema.mof b/source/DSCResources/DSC_IisMimeTypeMapping/DSC_IisMimeTypeMapping.schema.mof similarity index 83% rename from source/DSCResources/MSFT_xIisMimeTypeMapping/MSFT_xIisMimeTypeMapping.schema.mof rename to source/DSCResources/DSC_IisMimeTypeMapping/DSC_IisMimeTypeMapping.schema.mof index 8764789d9..2cf9c94c9 100644 --- a/source/DSCResources/MSFT_xIisMimeTypeMapping/MSFT_xIisMimeTypeMapping.schema.mof +++ b/source/DSCResources/DSC_IisMimeTypeMapping/DSC_IisMimeTypeMapping.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("1.0.0"), FriendlyName("xIisMimeTypeMapping")] -class MSFT_xIisMimeTypeMapping : OMI_BaseResource +[ClassVersion("1.0.0"), FriendlyName("IisMimeTypeMapping")] +class DSC_IisMimeTypeMapping : OMI_BaseResource { [Key, Description("This can be either an IIS configuration path in the format computername/webroot/apphost, or the IIS module path in this format IIS:\\sites\\Default Web Site.")] String ConfigurationPath; [Key, Description("The file extension to map such as .html or .xml.")] string Extension; diff --git a/source/DSCResources/MSFT_xIisMimeTypeMapping/README.md b/source/DSCResources/DSC_IisMimeTypeMapping/README.md similarity index 52% rename from source/DSCResources/MSFT_xIisMimeTypeMapping/README.md rename to source/DSCResources/DSC_IisMimeTypeMapping/README.md index c42a58811..dd939bab0 100644 --- a/source/DSCResources/MSFT_xIisMimeTypeMapping/README.md +++ b/source/DSCResources/DSC_IisMimeTypeMapping/README.md @@ -1,6 +1,6 @@ # Description -The `xIisMimeTypeMapping` DSC resource is used to... +The `IisMimeTypeMapping` DSC resource is used to... ## Requirements @@ -8,4 +8,4 @@ The `xIisMimeTypeMapping` DSC resource is used to... ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xIisMimeTypeMapping). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministrationDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+IisMimeTypeMapping). diff --git a/source/DSCResources/MSFT_xIisMimeTypeMapping/en-US/MSFT_xIisMimeTypeMapping.strings.psd1 b/source/DSCResources/DSC_IisMimeTypeMapping/en-US/DSC_IisMimeTypeMapping.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xIisMimeTypeMapping/en-US/MSFT_xIisMimeTypeMapping.strings.psd1 rename to source/DSCResources/DSC_IisMimeTypeMapping/en-US/DSC_IisMimeTypeMapping.strings.psd1 diff --git a/source/DSCResources/MSFT_xIisModule/MSFT_xIisModule.psm1 b/source/DSCResources/DSC_IisModule/DSC_IisModule.psm1 similarity index 93% rename from source/DSCResources/MSFT_xIisModule/MSFT_xIisModule.psm1 rename to source/DSCResources/DSC_IisModule/DSC_IisModule.psm1 index 0ce43e3af..af0d8b895 100644 --- a/source/DSCResources/MSFT_xIisModule/MSFT_xIisModule.psm1 +++ b/source/DSCResources/DSC_IisModule/DSC_IisModule.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xIisModule' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' function Get-TargetResource { @@ -38,7 +41,7 @@ function Get-TargetResource [String] $SiteName ) - Assert-Module + Assert-Module -ModuleName WebAdministration $currentVerbs = @() $Ensure = 'Absent' @@ -123,9 +126,9 @@ function Set-TargetResource [String] $SiteName ) - $getParameters = Get-PSBoundParameters -FunctionParameters $PSBoundParameters + $getParameters = Get-PSBoundParameters -FunctionParameters $PSBoundParameters $resourceStatus = Get-TargetResource @GetParameters - $resourceTests = Test-TargetResourceImpl @PSBoundParameters -ResourceStatus $resourceStatus + $resourceTests = Test-TargetResourceImpl @PSBoundParameters -ResourceStatus $resourceStatus if ($resourceTests.Result) { return diff --git a/source/DSCResources/MSFT_xIisModule/MSFT_xIisModule.schema.mof b/source/DSCResources/DSC_IisModule/DSC_IisModule.schema.mof similarity index 89% rename from source/DSCResources/MSFT_xIisModule/MSFT_xIisModule.schema.mof rename to source/DSCResources/DSC_IisModule/DSC_IisModule.schema.mof index 135e12d76..0a767ab09 100644 --- a/source/DSCResources/MSFT_xIisModule/MSFT_xIisModule.schema.mof +++ b/source/DSCResources/DSC_IisModule/DSC_IisModule.schema.mof @@ -1,6 +1,6 @@ -[ClassVersion("1.0.0"), FriendlyName("xIisModule")] -class MSFT_xIisModule : OMI_BaseResource +[ClassVersion("1.0.0"), FriendlyName("IisModule")] +class DSC_IisModule : OMI_BaseResource { [Key, Description("The path to the module, usually a dll, to be added to IIS.")] String Path; [Required, Description("The logical name of the module to add to IIS.")] String Name; diff --git a/source/DSCResources/MSFT_xIisModule/README.md b/source/DSCResources/DSC_IisModule/README.md similarity index 55% rename from source/DSCResources/MSFT_xIisModule/README.md rename to source/DSCResources/DSC_IisModule/README.md index a170dbc71..9112563d9 100644 --- a/source/DSCResources/MSFT_xIisModule/README.md +++ b/source/DSCResources/DSC_IisModule/README.md @@ -1,6 +1,6 @@ # Description -The `xIISModule` DSC resource is used to... +The `IisModule` DSC resource is used to... ## Requirements @@ -8,4 +8,4 @@ The `xIISModule` DSC resource is used to... ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xIISModule). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministrationDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+IisModule). diff --git a/source/DSCResources/MSFT_xIisModule/en-US/MSFT_xIisModule.strings.psd1 b/source/DSCResources/DSC_IisModule/en-US/DSC_IisModule.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xIisModule/en-US/MSFT_xIisModule.strings.psd1 rename to source/DSCResources/DSC_IisModule/en-US/DSC_IisModule.strings.psd1 diff --git a/source/DSCResources/MSFT_xSslSettings/MSFT_xSslSettings.psm1 b/source/DSCResources/DSC_SslSettings/DSC_SslSettings.psm1 similarity index 87% rename from source/DSCResources/MSFT_xSslSettings/MSFT_xSslSettings.psm1 rename to source/DSCResources/DSC_SslSettings/DSC_SslSettings.psm1 index 2cc642c7c..0bca0c3e5 100644 --- a/source/DSCResources/MSFT_xSslSettings/MSFT_xSslSettings.psm1 +++ b/source/DSCResources/DSC_SslSettings/DSC_SslSettings.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xSslSettings' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSIS @@ -26,7 +29,7 @@ function Get-TargetResource [String[]] $Bindings ) - Assert-Module + Assert-Module -ModuleName WebAdministration $ensure = 'Absent' @@ -88,7 +91,7 @@ function Set-TargetResource [String] $Ensure = 'Present' ) - Assert-Module + Assert-Module -ModuleName WebAdministration if ($Ensure -eq 'Absent' -or $Bindings.toLower().Contains('none')) { diff --git a/source/DSCResources/MSFT_xSslSettings/MSFT_xSslSettings.schema.mof b/source/DSCResources/DSC_SslSettings/DSC_SslSettings.schema.mof similarity index 82% rename from source/DSCResources/MSFT_xSslSettings/MSFT_xSslSettings.schema.mof rename to source/DSCResources/DSC_SslSettings/DSC_SslSettings.schema.mof index 7689ca3ea..a6eccabdf 100644 --- a/source/DSCResources/MSFT_xSslSettings/MSFT_xSslSettings.schema.mof +++ b/source/DSCResources/DSC_SslSettings/DSC_SslSettings.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("1.0.0"), FriendlyName("xSslSettings")] -class MSFT_xSslSettings : OMI_BaseResource +[ClassVersion("1.0.0"), FriendlyName("SslSettings")] +class DSC_SslSettings : OMI_BaseResource { [Key, Description("Name of website in which to modify the SSL Settings")] String Name; [Required, Description("The Bindings in which to modify for the website"), ValueMap{"","Ssl","SslNegotiateCert","SslRequireCert","Ssl128"},Values{"","Ssl","SslNegotiateCert","SslRequireCert","Ssl128"}] String Bindings[]; diff --git a/source/DSCResources/MSFT_xSslSettings/README.md b/source/DSCResources/DSC_SslSettings/README.md similarity index 54% rename from source/DSCResources/MSFT_xSslSettings/README.md rename to source/DSCResources/DSC_SslSettings/README.md index 9fae78d6b..9a7b48b99 100644 --- a/source/DSCResources/MSFT_xSslSettings/README.md +++ b/source/DSCResources/DSC_SslSettings/README.md @@ -1,6 +1,6 @@ # Description -The `xSslSettings` DSC resource is used to... +The `SslSettings` DSC resource is used to... ## Requirements @@ -8,4 +8,4 @@ The `xSslSettings` DSC resource is used to... ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xSslSettings). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministrationDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+SslSettings). diff --git a/source/DSCResources/MSFT_xSslSettings/en-US/MSFT_xSslSettings.strings.psd1 b/source/DSCResources/DSC_SslSettings/en-US/DSC_SslSettings.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xSslSettings/en-US/MSFT_xSslSettings.strings.psd1 rename to source/DSCResources/DSC_SslSettings/en-US/DSC_SslSettings.strings.psd1 diff --git a/source/DSCResources/MSFT_xWebAppPool/MSFT_xWebAppPool.psm1 b/source/DSCResources/DSC_WebAppPool/DSC_WebAppPool.psm1 similarity index 98% rename from source/DSCResources/MSFT_xWebAppPool/MSFT_xWebAppPool.psm1 rename to source/DSCResources/DSC_WebAppPool/DSC_WebAppPool.psm1 index 926bb7b2d..e15f119f9 100644 --- a/source/DSCResources/MSFT_xWebAppPool/MSFT_xWebAppPool.psm1 +++ b/source/DSCResources/DSC_WebAppPool/DSC_WebAppPool.psm1 @@ -1,13 +1,14 @@ -#requires -Version 4.0 -Modules CimCmdlets +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebAppPool' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' # Writable properties except Ensure and Credential. data PropertyData @@ -240,7 +241,7 @@ function Get-TargetResource [String] $Name ) - Assert-Module + Assert-Module -ModuleName WebAdministration # XPath -Filter is case-sensitive. Use Where-Object to get the target application pool by name. $appPool = Get-WebConfiguration -Filter '/system.applicationHost/applicationPools/add' | @@ -517,7 +518,7 @@ function Set-TargetResource return } - Assert-Module + Assert-Module -ModuleName WebAdministration $appPool = Get-WebConfiguration -Filter '/system.applicationHost/applicationPools/add' | Where-Object -FilterScript {$_.name -eq $Name} @@ -931,7 +932,7 @@ function Test-TargetResource [String[]] $restartSchedule ) - Assert-Module + Assert-Module -ModuleName WebAdministration $inDesiredState = $true diff --git a/source/DSCResources/MSFT_xWebAppPool/MSFT_xWebAppPool.schema.mof b/source/DSCResources/DSC_WebAppPool/DSC_WebAppPool.schema.mof similarity index 99% rename from source/DSCResources/MSFT_xWebAppPool/MSFT_xWebAppPool.schema.mof rename to source/DSCResources/DSC_WebAppPool/DSC_WebAppPool.schema.mof index 984ce32ef..e38dd666e 100644 --- a/source/DSCResources/MSFT_xWebAppPool/MSFT_xWebAppPool.schema.mof +++ b/source/DSCResources/DSC_WebAppPool/DSC_WebAppPool.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("1.0.0.0"), FriendlyName("xWebAppPool")] -class MSFT_xWebAppPool : OMI_BaseResource +[ClassVersion("1.0.0.0"), FriendlyName("WebAppPool")] +class DSC_WebAppPool : OMI_BaseResource { [Key, Description("Indicates the application pool name. The value must contain between 1 and 64 characters.")] String Name; [Write, Description("Indicates if the application pool exists. Set this property to Absent to ensure that the application pool does not exist. Setting it to Present (the default value) ensures that the application pool exists."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; diff --git a/source/DSCResources/MSFT_xWebAppPool/README.md b/source/DSCResources/DSC_WebAppPool/README.md similarity index 54% rename from source/DSCResources/MSFT_xWebAppPool/README.md rename to source/DSCResources/DSC_WebAppPool/README.md index ce0ea592c..92d90efe4 100644 --- a/source/DSCResources/MSFT_xWebAppPool/README.md +++ b/source/DSCResources/DSC_WebAppPool/README.md @@ -1,6 +1,6 @@ # Description -The `xWebAppPool` DSC resource is used to... +The `WebAppPool` DSC resource is used to... ## Requirements @@ -8,4 +8,4 @@ The `xWebAppPool` DSC resource is used to... ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebAppPool). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebAppPool). diff --git a/source/DSCResources/MSFT_xWebAppPool/en-US/MSFT_xWebAppPool.strings.psd1 b/source/DSCResources/DSC_WebAppPool/en-US/DSC_WebAppPool.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xWebAppPool/en-US/MSFT_xWebAppPool.strings.psd1 rename to source/DSCResources/DSC_WebAppPool/en-US/DSC_WebAppPool.strings.psd1 diff --git a/source/DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1 b/source/DSCResources/DSC_WebAppPoolDefaults/DSC_WebAppPoolDefaults.psm1 similarity index 88% rename from source/DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1 rename to source/DSCResources/DSC_WebAppPoolDefaults/DSC_WebAppPoolDefaults.psm1 index f3892affd..94f29be15 100644 --- a/source/DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1 +++ b/source/DSCResources/DSC_WebAppPoolDefaults/DSC_WebAppPoolDefaults.psm1 @@ -1,12 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) -# Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebAppPoolDefaults' +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') +# Import Localization Strings +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' function Get-TargetResource { <# @@ -24,7 +26,7 @@ function Get-TargetResource $IsSingleInstance ) - Assert-Module + Assert-Module -ModuleName WebAdministration Write-Verbose -Message $script:localizedData.VerboseGetTargetResource @@ -61,7 +63,7 @@ function Set-TargetResource $IdentityType ) - Assert-Module + Assert-Module -ModuleName WebAdministration Set-Value -Path '' -Name 'managedRuntimeVersion' -NewValue $ManagedRuntimeVersion Set-Value -Path 'processModel' -Name 'identityType' -NewValue $IdentityType @@ -96,7 +98,7 @@ function Test-TargetResource $IdentityType ) - Assert-Module + Assert-Module -ModuleName WebAdministration if (-not((Confirm-Value -Path '' ` -Name 'managedRuntimeVersion' ` diff --git a/source/DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.schema.mof b/source/DSCResources/DSC_WebAppPoolDefaults/DSC_WebAppPoolDefaults.schema.mof similarity index 84% rename from source/DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.schema.mof rename to source/DSCResources/DSC_WebAppPoolDefaults/DSC_WebAppPoolDefaults.schema.mof index 66e6905fd..9cfd7941f 100644 --- a/source/DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.schema.mof +++ b/source/DSCResources/DSC_WebAppPoolDefaults/DSC_WebAppPoolDefaults.schema.mof @@ -1,6 +1,6 @@ -[ClassVersion("1.0.0.0"), FriendlyName("xWebAppPoolDefaults")] -class MSFT_xWebAppPoolDefaults : OMI_BaseResource +[ClassVersion("1.0.0.0"), FriendlyName("WebAppPoolDefaults")] +class DSC_WebAppPoolDefaults : OMI_BaseResource { [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; [write, Description("applicationPools/applicationPoolDefaults/managedRuntimeVersion"), ValueMap{"","v2.0","v4.0"}, Values{"","v2.0","v4.0"}] string ManagedRuntimeVersion; diff --git a/source/DSCResources/MSFT_xWebApplication/README.md b/source/DSCResources/DSC_WebAppPoolDefaults/README.md similarity index 52% rename from source/DSCResources/MSFT_xWebApplication/README.md rename to source/DSCResources/DSC_WebAppPoolDefaults/README.md index aa87eaa9a..c810da24a 100644 --- a/source/DSCResources/MSFT_xWebApplication/README.md +++ b/source/DSCResources/DSC_WebAppPoolDefaults/README.md @@ -1,6 +1,6 @@ # Description -The `xWebApplication` DSC resource is used to... +The `WebAppPoolDefaults` DSC resource is used to... ## Requirements @@ -8,4 +8,4 @@ The `xWebApplication` DSC resource is used to... ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebApplication). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebAppPoolDefaults). diff --git a/source/DSCResources/MSFT_xWebAppPoolDefaults/en-US/MSFT_xWebAppPoolDefaults.strings.psd1 b/source/DSCResources/DSC_WebAppPoolDefaults/en-US/DSC_WebAppPoolDefaults.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xWebAppPoolDefaults/en-US/MSFT_xWebAppPoolDefaults.strings.psd1 rename to source/DSCResources/DSC_WebAppPoolDefaults/en-US/DSC_WebAppPoolDefaults.strings.psd1 diff --git a/source/DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.psm1 b/source/DSCResources/DSC_WebApplication/DSC_WebApplication.psm1 similarity index 96% rename from source/DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.psm1 rename to source/DSCResources/DSC_WebApplication/DSC_WebApplication.psm1 index 4b8d5118d..86fcfce4f 100644 --- a/source/DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.psm1 +++ b/source/DSCResources/DSC_WebApplication/DSC_WebApplication.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebApplication' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSIS @@ -30,7 +33,7 @@ function Get-TargetResource [String] $PhysicalPath ) - Assert-Module + Assert-Module -ModuleName WebAdministration $webApplication = Get-WebApplication -Site $Website -Name $Name $cimAuthentication = Get-AuthenticationInfo -Site $Website -Name $Name @@ -118,7 +121,7 @@ function Set-TargetResource [String[]] $EnabledProtocols ) - Assert-Module + Assert-Module -ModuleName WebAdministration if ($Ensure -eq 'Present') { @@ -144,7 +147,7 @@ function Set-TargetResource { Write-Verbose -Message ($script:localizedData.VerboseSetTargetPhysicalPath -f $Name) #Note: read this before touching the next line of code: - # https://github.com/PowerShell/xWebAdministration/issues/222 + # https://github.com/PowerShell/WebAdministrationDsc/issues/222 Set-WebConfigurationProperty ` -Filter "$($webApplication.ItemXPath)/virtualDirectory[@path='/']" ` -Name physicalPath ` @@ -157,7 +160,7 @@ function Set-TargetResource { Write-Verbose -Message ($script:localizedData.VerboseSetTargetWebAppPool -f $Name) #Note: read this before touching the next line of code: - # https://github.com/PowerShell/xWebAdministration/issues/222 + # https://github.com/PowerShell/WebAdministrationDsc/issues/222 Set-WebConfigurationProperty ` -Filter $webApplication.ItemXPath ` -Name applicationPool ` @@ -320,7 +323,7 @@ function Test-TargetResource [String[]] $EnabledProtocols ) - Assert-Module + Assert-Module -ModuleName WebAdministration $webApplication = Get-WebApplication -Site $Website -Name $Name diff --git a/source/DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.schema.mof b/source/DSCResources/DSC_WebApplication/DSC_WebApplication.schema.mof similarity index 82% rename from source/DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.schema.mof rename to source/DSCResources/DSC_WebApplication/DSC_WebApplication.schema.mof index 91815cdb6..3d6a8e96e 100644 --- a/source/DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.schema.mof +++ b/source/DSCResources/DSC_WebApplication/DSC_WebApplication.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("1.0.0.0"), FriendlyName("xWebApplication")] -class MSFT_xWebApplication : OMI_BaseResource +[ClassVersion("1.0.0.0"), FriendlyName("WebApplication")] +class DSC_WebApplication : OMI_BaseResource { [Key, Description("Name of website with which web application is associated")] String Website; [Key, Description("Name of web application")] String Name; @@ -7,7 +7,7 @@ class MSFT_xWebApplication : OMI_BaseResource [Required, Description("Physical path for the web application directory")] String PhysicalPath; [Write, Description("Whether web application should be present or absent"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; [Write, Description("SSLFlags for the application"), ValueMap{"","Ssl","SslNegotiateCert","SslRequireCert","Ssl128"},Values{"","Ssl","SslNegotiateCert","SslRequireCert","Ssl128"}] String SslFlags[]; - [write, EmbeddedInstance("MSFT_xWebApplicationAuthenticationInformation"), Description("Hashtable containing authentication information (Anonymous, Basic, Digest, Windows)")] String AuthenticationInfo; + [write, EmbeddedInstance("DSC_WebApplicationAuthenticationInformation"), Description("Hashtable containing authentication information (Anonymous, Basic, Digest, Windows)")] String AuthenticationInfo; [Write, Description ("Allows a Application to automatically start without a request")] Boolean PreloadEnabled; [Write, Description ("Enables Autostart on an Application.")] Boolean ServiceAutoStartEnabled; [Write, Description ("Adds a AutostartProvider")] String ServiceAutoStartProvider; @@ -16,7 +16,7 @@ class MSFT_xWebApplication : OMI_BaseResource }; [ClassVersion("1.0.0")] -class MSFT_xWebApplicationAuthenticationInformation +class DSC_WebApplicationAuthenticationInformation { [Write, Description ("Enable anonymous authentication")] Boolean Anonymous; [Write, Description ("Enable basic authentication")] Boolean Basic; diff --git a/source/DSCResources/DSC_WebApplication/README.md b/source/DSCResources/DSC_WebApplication/README.md new file mode 100644 index 000000000..c8186c9f6 --- /dev/null +++ b/source/DSCResources/DSC_WebApplication/README.md @@ -0,0 +1,11 @@ +# Description + +The `WebApplication` DSC resource is used to... + +## Requirements + +* Target machine must be running Windows Server 2012 R2 or later. + +## Known issues + +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebApplication). diff --git a/source/DSCResources/MSFT_xWebApplication/en-US/MSFT_xWebApplication.strings.psd1 b/source/DSCResources/DSC_WebApplication/en-US/DSC_WebApplication.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xWebApplication/en-US/MSFT_xWebApplication.strings.psd1 rename to source/DSCResources/DSC_WebApplication/en-US/DSC_WebApplication.strings.psd1 diff --git a/source/DSCResources/MSFT_WebApplicationHandler/MSFT_WebApplicationHandler.psm1 b/source/DSCResources/DSC_WebApplicationHandler/DSC_WebApplicationHandler.psm1 similarity index 95% rename from source/DSCResources/MSFT_WebApplicationHandler/MSFT_WebApplicationHandler.psm1 rename to source/DSCResources/DSC_WebApplicationHandler/DSC_WebApplicationHandler.psm1 index 9ee3828da..c7e576133 100644 --- a/source/DSCResources/MSFT_WebApplicationHandler/MSFT_WebApplicationHandler.psm1 +++ b/source/DSCResources/DSC_WebApplicationHandler/DSC_WebApplicationHandler.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_WebApplicationHandler' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSIS diff --git a/source/DSCResources/MSFT_WebApplicationHandler/MSFT_WebApplicationHandler.schema.mof b/source/DSCResources/DSC_WebApplicationHandler/DSC_WebApplicationHandler.schema.mof similarity index 97% rename from source/DSCResources/MSFT_WebApplicationHandler/MSFT_WebApplicationHandler.schema.mof rename to source/DSCResources/DSC_WebApplicationHandler/DSC_WebApplicationHandler.schema.mof index 40647175c..c4d2c50fa 100644 --- a/source/DSCResources/MSFT_WebApplicationHandler/MSFT_WebApplicationHandler.schema.mof +++ b/source/DSCResources/DSC_WebApplicationHandler/DSC_WebApplicationHandler.schema.mof @@ -1,5 +1,5 @@ [ClassVersion("1.0.0.0"), FriendlyName("WebApplicationHandler")] -class MSFT_WebApplicationHandler : OMI_BaseResource +class DSC_WebApplicationHandler : OMI_BaseResource { [Key, Description("Specifies the name of the new request handler.")] String Name; [Write, Description("Indicates if the application handler exists. Set this property to `Absent` to ensure that the application handler does not exist. Default value is 'Present'."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; diff --git a/source/DSCResources/MSFT_WebApplicationHandler/README.md b/source/DSCResources/DSC_WebApplicationHandler/README.md similarity index 67% rename from source/DSCResources/MSFT_WebApplicationHandler/README.md rename to source/DSCResources/DSC_WebApplicationHandler/README.md index ec9ab9742..4dc6a98c1 100644 --- a/source/DSCResources/MSFT_WebApplicationHandler/README.md +++ b/source/DSCResources/DSC_WebApplicationHandler/README.md @@ -8,4 +8,4 @@ The `WebApplicationHandler` DSC resource is used to ... ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebApplicationHandler). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebApplicationHandler). diff --git a/source/DSCResources/MSFT_WebApplicationHandler/en-US/MSFT_WebApplicationHandler.strings.psd1 b/source/DSCResources/DSC_WebApplicationHandler/en-US/DSC_WebApplicationHandler.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_WebApplicationHandler/en-US/MSFT_WebApplicationHandler.strings.psd1 rename to source/DSCResources/DSC_WebApplicationHandler/en-US/DSC_WebApplicationHandler.strings.psd1 diff --git a/source/DSCResources/MSFT_xWebConfigProperty/MSFT_xWebConfigProperty.psm1 b/source/DSCResources/DSC_WebConfigProperty/DSC_WebConfigProperty.psm1 similarity index 94% rename from source/DSCResources/MSFT_xWebConfigProperty/MSFT_xWebConfigProperty.psm1 rename to source/DSCResources/DSC_WebConfigProperty/DSC_WebConfigProperty.psm1 index 28ba04240..6b394c781 100644 --- a/source/DSCResources/MSFT_xWebConfigProperty/MSFT_xWebConfigProperty.psm1 +++ b/source/DSCResources/DSC_WebConfigProperty/DSC_WebConfigProperty.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebConfigProperty' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSIS diff --git a/source/DSCResources/MSFT_xWebConfigProperty/MSFT_xWebConfigProperty.schema.mof b/source/DSCResources/DSC_WebConfigProperty/DSC_WebConfigProperty.schema.mof similarity index 82% rename from source/DSCResources/MSFT_xWebConfigProperty/MSFT_xWebConfigProperty.schema.mof rename to source/DSCResources/DSC_WebConfigProperty/DSC_WebConfigProperty.schema.mof index d2a7576a9..4e363fd9c 100644 --- a/source/DSCResources/MSFT_xWebConfigProperty/MSFT_xWebConfigProperty.schema.mof +++ b/source/DSCResources/DSC_WebConfigProperty/DSC_WebConfigProperty.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("1.0.0.0"), FriendlyName("xWebConfigProperty")] -class MSFT_xWebConfigProperty : OMI_BaseResource +[ClassVersion("1.0.0.0"), FriendlyName("WebConfigProperty")] +class Dsc_WebConfigProperty : OMI_BaseResource { [Key, Description("Path to website location (IIS or WebAdministration format).")] String WebsitePath; [Key, Description("Filter used to locate property to update.")] String Filter; diff --git a/source/DSCResources/MSFT_xWebConfigProperty/README.md b/source/DSCResources/DSC_WebConfigProperty/README.md similarity index 55% rename from source/DSCResources/MSFT_xWebConfigProperty/README.md rename to source/DSCResources/DSC_WebConfigProperty/README.md index 6c631ac9e..f0638ca55 100644 --- a/source/DSCResources/MSFT_xWebConfigProperty/README.md +++ b/source/DSCResources/DSC_WebConfigProperty/README.md @@ -1,6 +1,6 @@ # Description -The `xWebConfigProperty` DSC resource is used to ensure the value of an +The `WebConfigProperty` DSC resource is used to ensure the value of an identified property in the web.config file. ## Requirements @@ -9,4 +9,4 @@ identified property in the web.config file. ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebConfigProperty). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebConfigProperty). diff --git a/source/DSCResources/MSFT_xWebConfigProperty/en-US/MSFT_xWebConfigProperty.strings.psd1 b/source/DSCResources/DSC_WebConfigProperty/en-US/DSC_WebConfigProperty.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xWebConfigProperty/en-US/MSFT_xWebConfigProperty.strings.psd1 rename to source/DSCResources/DSC_WebConfigProperty/en-US/DSC_WebConfigProperty.strings.psd1 diff --git a/source/DSCResources/MSFT_xWebConfigPropertyCollection/MSFT_xWebConfigPropertyCollection.psm1 b/source/DSCResources/DSC_WebConfigPropertyCollection/DSC_WebConfigPropertyCollection.psm1 similarity index 97% rename from source/DSCResources/MSFT_xWebConfigPropertyCollection/MSFT_xWebConfigPropertyCollection.psm1 rename to source/DSCResources/DSC_WebConfigPropertyCollection/DSC_WebConfigPropertyCollection.psm1 index 8957e7695..d41dd6fa5 100644 --- a/source/DSCResources/MSFT_xWebConfigPropertyCollection/MSFT_xWebConfigPropertyCollection.psm1 +++ b/source/DSCResources/DSC_WebConfigPropertyCollection/DSC_WebConfigPropertyCollection.psm1 @@ -1,12 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) -# Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebConfigPropertyCollection' +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') +# Import Localization Strings +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSIS diff --git a/source/DSCResources/MSFT_xWebConfigPropertyCollection/MSFT_xWebConfigPropertyCollection.schema.mof b/source/DSCResources/DSC_WebConfigPropertyCollection/DSC_WebConfigPropertyCollection.schema.mof similarity index 86% rename from source/DSCResources/MSFT_xWebConfigPropertyCollection/MSFT_xWebConfigPropertyCollection.schema.mof rename to source/DSCResources/DSC_WebConfigPropertyCollection/DSC_WebConfigPropertyCollection.schema.mof index a57c913d2..14e1f765a 100644 --- a/source/DSCResources/MSFT_xWebConfigPropertyCollection/MSFT_xWebConfigPropertyCollection.schema.mof +++ b/source/DSCResources/DSC_WebConfigPropertyCollection/DSC_WebConfigPropertyCollection.schema.mof @@ -1,9 +1,9 @@ -[ClassVersion("1.0.0.0"), FriendlyName("xWebConfigPropertyCollection")] -class MSFT_xWebConfigPropertyCollection : OMI_BaseResource +[ClassVersion("1.0.0.0"), FriendlyName("WebConfigPropertyCollection")] +class DSC_WebConfigPropertyCollection : OMI_BaseResource { [Key, Description("Path to website location (IIS or WebAdministration format).")] String WebsitePath; [Key, Description("Filter used to locate property collection to update.")] String Filter; - [Key, Description("Name of the property collection to update.")] String CollectionName; + [Key, Description("Name of the property collection to update.")] String CollectionName; [Key, Description("Name of the property collection item to update.")] String ItemName; [Key, Description("Name of the key of the property collection item to update.")] String ItemKeyName; [Key, Description("Value of the key of the property collection item to update.")] String ItemKeyValue; diff --git a/source/DSCResources/MSFT_xWebConfigPropertyCollection/README.md b/source/DSCResources/DSC_WebConfigPropertyCollection/README.md similarity index 51% rename from source/DSCResources/MSFT_xWebConfigPropertyCollection/README.md rename to source/DSCResources/DSC_WebConfigPropertyCollection/README.md index 95b883f80..6946e5858 100644 --- a/source/DSCResources/MSFT_xWebConfigPropertyCollection/README.md +++ b/source/DSCResources/DSC_WebConfigPropertyCollection/README.md @@ -1,9 +1,9 @@ # Description -The `xWebConfigPropertyCollection` DSC resource is used to ensure the value of an +The `WebConfigPropertyCollection` DSC resource is used to ensure the value of an identified property collection item's property in the web.config file. ->Builds upon the deprecated **xWebConfigKeyValue** resource to support all web.config +>Builds upon the deprecated **WebConfigKeyValue** resource to support all web.config >elements that contain collections of child items. ## Requirements @@ -12,4 +12,4 @@ identified property collection item's property in the web.config file. ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebConfigPropertyCollection). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebConfigPropertyCollection). diff --git a/source/DSCResources/MSFT_xWebConfigPropertyCollection/en-US/MSFT_xWebConfigPropertyCollection.strings.psd1 b/source/DSCResources/DSC_WebConfigPropertyCollection/en-US/DSC_WebConfigPropertyCollection.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xWebConfigPropertyCollection/en-US/MSFT_xWebConfigPropertyCollection.strings.psd1 rename to source/DSCResources/DSC_WebConfigPropertyCollection/en-US/DSC_WebConfigPropertyCollection.strings.psd1 diff --git a/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1 b/source/DSCResources/DSC_WebSite/DSC_WebSite.psm1 similarity index 98% rename from source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1 rename to source/DSCResources/DSC_WebSite/DSC_WebSite.psm1 index ea3e5b285..b38c03514 100644 --- a/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1 +++ b/source/DSCResources/DSC_WebSite/DSC_WebSite.psm1 @@ -1,13 +1,14 @@ -#requires -Version 4.0 -Modules CimCmdlets +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebSite' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSYS @@ -30,7 +31,7 @@ function Get-TargetResource $Name ) - Assert-Module + Assert-Module -ModuleName WebAdministration $website = Get-Website | Where-Object -FilterScript {$_.Name -eq $Name} @@ -224,7 +225,7 @@ function Set-TargetResource $LogCustomFields ) - Assert-Module + Assert-Module -ModuleName WebAdministration $website = Get-Website | Where-Object -FilterScript {$_.Name -eq $Name} @@ -791,7 +792,7 @@ function Test-TargetResource $LogCustomFields ) - Assert-Module + Assert-Module -ModuleName WebAdministration $inDesiredState = $true @@ -1243,7 +1244,7 @@ function Confirm-UniqueServiceAutoStartProviders <# .SYNOPSIS - Converts IIS elements to instances of the MSFT_xWebBindingInformation CIM class. + Converts IIS elements to instances of the DSC_WebBindingInformation CIM class. #> function ConvertTo-CimBinding { @@ -1260,7 +1261,7 @@ function ConvertTo-CimBinding begin { - $cimClassName = 'MSFT_xWebBindingInformation' + $cimClassName = 'DSC_WebBindingInformation' $cimNamespace = 'root/microsoft/Windows/DesiredStateConfiguration' } @@ -1321,7 +1322,7 @@ function ConvertTo-CimBinding <# .SYNOPSIS - Converts instances of the MSFT_xWebBindingInformation CIM class to the IIS + Converts instances of the DSC_WebBindingInformation CIM class to the IIS element representation. .LINK @@ -1562,7 +1563,7 @@ function ConvertTo-WebBinding <# .SYNOPSIS - Converts IIS custom log field collection to instances of the MSFT_xLogCustomFieldInformation CIM class. + Converts IIS custom log field collection to instances of the DSC_LogCustomFieldInformation CIM class. #> function ConvertTo-CimLogCustomFields { @@ -1577,7 +1578,7 @@ function ConvertTo-CimLogCustomFields $InputObject ) - $cimClassName = 'MSFT_xLogCustomFieldInformation' + $cimClassName = 'DSC_LogCustomFieldInformation' $cimNamespace = 'root/microsoft/Windows/DesiredStateConfiguration' $cimCollection = New-Object -TypeName 'System.Collections.ObjectModel.Collection`1[Microsoft.Management.Infrastructure.CimInstance]' @@ -1675,7 +1676,7 @@ function Get-AuthenticationInfo } return New-CimInstance ` - -ClassName MSFT_xWebAuthenticationInformation ` + -ClassName DSC_WebAuthenticationInformation ` -ClientOnly -Property $authenticationProperties ` -NameSpace 'root\microsoft\windows\desiredstateconfiguration' } @@ -1686,7 +1687,7 @@ function Get-AuthenticationInfo #> function Get-DefaultAuthenticationInfo { - New-CimInstance -ClassName MSFT_xWebAuthenticationInformation ` + New-CimInstance -ClassName DSC_WebAuthenticationInformation ` -ClientOnly ` -Property @{ Anonymous = $false diff --git a/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.schema.mof b/source/DSCResources/DSC_WebSite/DSC_WebSite.schema.mof similarity index 88% rename from source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.schema.mof rename to source/DSCResources/DSC_WebSite/DSC_WebSite.schema.mof index 9ac1c7c76..10f127f5a 100644 --- a/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.schema.mof +++ b/source/DSCResources/DSC_WebSite/DSC_WebSite.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("2.0.0"), FriendlyName("xWebSite")] -class MSFT_xWebSite : OMI_BaseResource +[ClassVersion("2.0.0"), FriendlyName("WebSite")] +class DSC_WebSite : OMI_BaseResource { [Write, Description("Ensures that the website is Present or Absent. Defaults to Present."), ValueMap{"Present", "Absent"},Values{"Present", "Absent"}] String Ensure; [Key, Description("The desired name of the website.")] String Name; @@ -7,11 +7,11 @@ class MSFT_xWebSite : OMI_BaseResource [Write, Description("The path to the files that compose the website.")] String PhysicalPath; [Write, Description("The state of the website."),ValueMap{"Started","Stopped"},Values{"Started", "Stopped"}] String State; [Write, Description("The name of the website’s application pool.")] String ApplicationPool; - [Write, EmbeddedInstance("MSFT_xWebBindingInformation"), Description("Website's binding information in the form of an array of embedded instances of the MSFT_xWebBindingInformation CIM class.")] String BindingInfo[]; + [Write, EmbeddedInstance("DSC_WebBindingInformation"), Description("Website's binding information in the form of an array of embedded instances of the DSC_WebBindingInformation CIM class.")] String BindingInfo[]; [Write, Description("One or more names of files that will be set as Default Documents for this website.")] String DefaultPage[]; [Write, Description("The protocols that are enabled for the website.")] String EnabledProtocols; [Write, Description ("When set to $true this will enable Autostart on a Website")] Boolean ServerAutoStart; - [write, EmbeddedInstance("MSFT_xWebAuthenticationInformation"), Description("Hashtable containing authentication information (Anonymous, Basic, Digest, Windows)")] String AuthenticationInfo; + [write, EmbeddedInstance("DSC_WebAuthenticationInformation"), Description("Hashtable containing authentication information (Anonymous, Basic, Digest, Windows)")] String AuthenticationInfo; [Write, Description ("When set to $true this will allow WebSite to automatically start without a request")] Boolean PreloadEnabled; [Write, Description ("When set to `$true` this will enable application Autostart (application initalization without an initial request) on a Website")] Boolean ServiceAutoStartEnabled; [Write, Description ("Adds a AutostartProvider")] String ServiceAutoStartProvider; @@ -23,11 +23,11 @@ class MSFT_xWebSite : OMI_BaseResource [Write, Description ("Use the localtime for file naming and rollover")] Boolean LoglocalTimeRollover; [Write, Description ("Format of the Logfiles. Only W3C supports LogFlags"), ValueMap{"IIS","W3C","NCSA"}, Values{"IIS","W3C","NCSA"}] String LogFormat; [Write, Description ("Specifies whether IIS will use Event Tracing or file logging"), ValueMap{"File","ETW","File,ETW"}, Values{"File","ETW","File,ETW"}] String LogTargetW3C; - [Write, EmbeddedInstance("MSFT_xLogCustomFieldInformation"), Description("Custom logging field information in the form of an array of embedded instances of MSFT_xLogCustomFieldInformation CIM class")] String LogCustomFields[]; + [Write, EmbeddedInstance("DSC_LogCustomFieldInformation"), Description("Custom logging field information in the form of an array of embedded instances of DSC_LogCustomFieldInformation CIM class")] String LogCustomFields[]; }; [ClassVersion("1.0.0")] -class MSFT_xWebBindingInformation +class DSC_WebBindingInformation { [Required,Description("The protocol of the binding. This property is required. The acceptable values for this property are: http, https, msmq.formatname, net.msmq, net.pipe, net.tcp."),ValueMap{"http","https","msmq.formatname","net.msmq","net.pipe","net.tcp"},Values{"http","https","msmq.formatname","net.msmq","net.pipe","net.tcp"}] String Protocol; [Write, Description("The binding information in the form a colon-delimited string that includes the IP address, port, and host name of the binding. This property is ignored for http and https bindings if at least one of the following properties is specified: IPAddress, Port, HostName.")] String BindingInformation; @@ -41,7 +41,7 @@ class MSFT_xWebBindingInformation }; [ClassVersion("1.0.0")] -class MSFT_xWebAuthenticationInformation +class DSC_WebAuthenticationInformation { [Write, Description("The acceptable values for this property are: $true, $false")] Boolean Anonymous; [Write, Description("The acceptable values for this property are: $true, $false")] Boolean Basic; @@ -50,7 +50,7 @@ class MSFT_xWebAuthenticationInformation }; [ClassVersion("1.0.0")] -class MSFT_xLogCustomFieldInformation +class DSC_LogCustomFieldInformation { [Write, Description("Field name to identify the custom field within the log file. Please note that the field name cannot contain spaces.")] String LogFieldName; [Write, Description("The acceptable values for this property are: RequestHeader, ResponseHeader or ServerVariable (note that enhanced logging cannot log a server variable with a name that contains lower-case characters - to include a server variable in the event log just make sure that its name consists of all upper-case characters)."),ValueMap{"RequestHeader","ResponseHeader","ServerVariable"},Values{"RequestHeader","ResponseHeader","ServerVariable"}] String SourceType; diff --git a/source/DSCResources/MSFT_xWebSite/README.md b/source/DSCResources/DSC_WebSite/README.md similarity index 55% rename from source/DSCResources/MSFT_xWebSite/README.md rename to source/DSCResources/DSC_WebSite/README.md index f36762eaf..19f3b169c 100644 --- a/source/DSCResources/MSFT_xWebSite/README.md +++ b/source/DSCResources/DSC_WebSite/README.md @@ -1,6 +1,6 @@ # Description -The `xWebSite` DSC resource is used to... +The `WebSite` DSC resource is used to... ## Requirements @@ -8,4 +8,4 @@ The `xWebSite` DSC resource is used to... ## Known issues -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebSite). +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebSite). diff --git a/source/DSCResources/MSFT_xWebSite/en-US/MSFT_xWebSite.strings.psd1 b/source/DSCResources/DSC_WebSite/en-US/DSC_WebSite.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xWebSite/en-US/MSFT_xWebSite.strings.psd1 rename to source/DSCResources/DSC_WebSite/en-US/DSC_WebSite.strings.psd1 diff --git a/source/DSCResources/MSFT_xWebSiteDefaults/MSFT_xWebSiteDefaults.psm1 b/source/DSCResources/DSC_WebSiteDefaults/DSC_WebSiteDefaults.psm1 similarity index 90% rename from source/DSCResources/MSFT_xWebSiteDefaults/MSFT_xWebSiteDefaults.psm1 rename to source/DSCResources/DSC_WebSiteDefaults/DSC_WebSiteDefaults.psm1 index 26023eff1..b93b3c114 100644 --- a/source/DSCResources/MSFT_xWebSiteDefaults/MSFT_xWebSiteDefaults.psm1 +++ b/source/DSCResources/DSC_WebSiteDefaults/DSC_WebSiteDefaults.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebSiteDefaults' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' function Get-TargetResource { @@ -24,7 +27,7 @@ function Get-TargetResource $IsSingleInstance ) - Assert-Module + Assert-Module -ModuleName WebAdministration Write-Verbose -Message $script:localizedData.VerboseGetTargetResource @@ -77,7 +80,7 @@ function Set-TargetResource [String] $AllowSubDirConfig ) - Assert-Module + Assert-Module -ModuleName WebAdministration Set-Value -Path 'siteDefaults/logFile' -Name 'logFormat' -NewValue $LogFormat Set-Value -Path 'siteDefaults/logFile' -Name 'directory' -NewValue $LogDirectory @@ -121,7 +124,7 @@ function Test-TargetResource [String] $AllowSubDirConfig ) - Assert-Module + Assert-Module -ModuleName WebAdministration # check for the various given settings: diff --git a/source/DSCResources/MSFT_xWebSiteDefaults/MSFT_xWebSiteDefaults.schema.mof b/source/DSCResources/DSC_WebSiteDefaults/DSC_WebSiteDefaults.schema.mof similarity index 87% rename from source/DSCResources/MSFT_xWebSiteDefaults/MSFT_xWebSiteDefaults.schema.mof rename to source/DSCResources/DSC_WebSiteDefaults/DSC_WebSiteDefaults.schema.mof index ce15c91eb..262cfd26c 100644 --- a/source/DSCResources/MSFT_xWebSiteDefaults/MSFT_xWebSiteDefaults.schema.mof +++ b/source/DSCResources/DSC_WebSiteDefaults/DSC_WebSiteDefaults.schema.mof @@ -1,5 +1,5 @@ -[ClassVersion("1.0.0"), FriendlyName("xWebSiteDefaults")] -class MSFT_xWebSiteDefaults : OMI_BaseResource +[ClassVersion("1.0.0"), FriendlyName("WebSiteDefaults")] +class DSC_WebSiteDefaults : OMI_BaseResource { [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; [write, Description("sites/siteDefaults/logFile/logFormat"), ValueMap{"W3C","IIS","NCSA","Custom"}, Values{"W3C","IIS","NCSA","Custom"}] string LogFormat; diff --git a/source/DSCResources/DSC_WebSiteDefaults/README.md b/source/DSCResources/DSC_WebSiteDefaults/README.md new file mode 100644 index 000000000..db1f6d0f6 --- /dev/null +++ b/source/DSCResources/DSC_WebSiteDefaults/README.md @@ -0,0 +1,11 @@ +# Description + +The `WebSiteDefaults` DSC resource is used to... + +## Requirements + +* Target machine must be running Windows Server 2012 R2 or later. + +## Known issues + +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebSiteDefaults). diff --git a/source/DSCResources/MSFT_xWebSiteDefaults/en-US/MSFT_xWebSiteDefaults.strings.psd1 b/source/DSCResources/DSC_WebSiteDefaults/en-US/DSC_WebSiteDefaults.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xWebSiteDefaults/en-US/MSFT_xWebSiteDefaults.strings.psd1 rename to source/DSCResources/DSC_WebSiteDefaults/en-US/DSC_WebSiteDefaults.strings.psd1 diff --git a/source/DSCResources/MSFT_xWebVirtualDirectory/MSFT_xWebVirtualDirectory.psm1 b/source/DSCResources/DSC_WebVirtualDirectory/DSC_WebVirtualDirectory.psm1 similarity index 88% rename from source/DSCResources/MSFT_xWebVirtualDirectory/MSFT_xWebVirtualDirectory.psm1 rename to source/DSCResources/DSC_WebVirtualDirectory/DSC_WebVirtualDirectory.psm1 index 4979287e2..92b9b8a72 100644 --- a/source/DSCResources/MSFT_xWebVirtualDirectory/MSFT_xWebVirtualDirectory.psm1 +++ b/source/DSCResources/DSC_WebVirtualDirectory/DSC_WebVirtualDirectory.psm1 @@ -1,11 +1,14 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') +# Import the WebAdministrationDsc Common Modules +Import-Module -Name (Join-Path -Path $modulePath ` + -ChildPath (Join-Path -Path 'WebAdministrationDsc.Common' ` + -ChildPath 'WebAdministrationDsc.Common.psm1')) + +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') # Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebVirtualDirectory' +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' function Get-TargetResource { @@ -35,7 +38,7 @@ function Get-TargetResource $PhysicalPath ) - Assert-Module + Assert-Module -ModuleName WebAdministration $virtualDirectory = Get-WebVirtualDirectory -Site $Website ` -Name $Name ` @@ -95,7 +98,7 @@ function Set-TargetResource $PhysicalPath ) - Assert-Module + Assert-Module -ModuleName WebAdministration if ($Ensure -eq 'Present') { @@ -172,7 +175,7 @@ function Test-TargetResource $PhysicalPath ) - Assert-Module + Assert-Module -ModuleName WebAdministration $virtualDirectory = Get-WebVirtualDirectory -Site $Website ` -Name $Name ` diff --git a/source/DSCResources/MSFT_xWebVirtualDirectory/MSFT_xWebVirtualDirectory.schema.mof b/source/DSCResources/DSC_WebVirtualDirectory/DSC_WebVirtualDirectory.schema.mof similarity index 81% rename from source/DSCResources/MSFT_xWebVirtualDirectory/MSFT_xWebVirtualDirectory.schema.mof rename to source/DSCResources/DSC_WebVirtualDirectory/DSC_WebVirtualDirectory.schema.mof index 30523659f..1e03e9d4c 100644 --- a/source/DSCResources/MSFT_xWebVirtualDirectory/MSFT_xWebVirtualDirectory.schema.mof +++ b/source/DSCResources/DSC_WebVirtualDirectory/DSC_WebVirtualDirectory.schema.mof @@ -1,6 +1,6 @@ -[ClassVersion("1.0.0.0"), FriendlyName("xWebVirtualDirectory")] -class MSFT_xWebVirtualDirectory : OMI_BaseResource +[ClassVersion("1.0.0.0"), FriendlyName("WebVirtualDirectory")] +class DSC_WebVirtualDirectory : OMI_BaseResource { [Key, Description("Name of website with which Web Application is associated")] string Website; [Key, Description("Web application name for the virtual directory")] string WebApplication; diff --git a/source/DSCResources/DSC_WebVirtualDirectory/README.md b/source/DSCResources/DSC_WebVirtualDirectory/README.md new file mode 100644 index 000000000..6bfbd3e41 --- /dev/null +++ b/source/DSCResources/DSC_WebVirtualDirectory/README.md @@ -0,0 +1,11 @@ +# Description + +The `WebVirtualDirectory` DSC resource is used to... + +## Requirements + +* Target machine must be running Windows Server 2012 R2 or later. + +## Known issues + +All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/WebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+WebVirtualDirectory). diff --git a/source/DSCResources/MSFT_xWebVirtualDirectory/en-US/MSFT_xWebVirtualDirectory.strings.psd1 b/source/DSCResources/DSC_WebVirtualDirectory/en-US/DSC_WebVirtualDirectory.strings.psd1 similarity index 100% rename from source/DSCResources/MSFT_xWebVirtualDirectory/en-US/MSFT_xWebVirtualDirectory.strings.psd1 rename to source/DSCResources/DSC_WebVirtualDirectory/en-US/DSC_WebVirtualDirectory.strings.psd1 diff --git a/source/DSCResources/MSFT_xIIsHandler/MSFT_xIisHandler.psm1 b/source/DSCResources/MSFT_xIIsHandler/MSFT_xIisHandler.psm1 deleted file mode 100644 index 3cfa2da36..000000000 --- a/source/DSCResources/MSFT_xIIsHandler/MSFT_xIisHandler.psm1 +++ /dev/null @@ -1,953 +0,0 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' - -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') - -# Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xIisHandler' - -#region script variables -$script:handlers = @{ - 'aspq-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'aspq-Integrated-4.0' - Path = '*.aspq' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.HttpForbiddenHandler' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'aspq-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'aspq-ISAPI-4.0_32bit' - Path = '*.aspq' - Verb = '*' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'aspq-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'aspq-ISAPI-4.0_64bit' - Path = '*.aspq' - Verb = '*' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'AssemblyResourceLoader-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'AssemblyResourceLoader-Integrated-4.0' - Path = 'WebResource.axd' - Verb = 'GET,DEBUG' - Type = 'System.Web.Handlers.AssemblyResourceLoader' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'AssemblyResourceLoader-Integrated' = New-Object PSObject -Property @{ - Name = 'AssemblyResourceLoader-Integrated' - Path = 'WebResource.axd' - Verb = 'GET,DEBUG' - Type = 'System.Web.Handlers.AssemblyResourceLoader' - PreCondition = 'integratedMode' - } - - 'AXD-ISAPI-2.0-64' = New-Object PSObject -Property @{ - Name = 'AXD-ISAPI-2.0-64' - Path = '*.axd' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness64' - ResponseBufferLimit = '0' - } - - 'AXD-ISAPI-2.0' = New-Object PSObject -Property @{ - Name = 'AXD-ISAPI-2.0' - Path = '*.axd' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness32' - ResponseBufferLimit = '0' - } - - 'AXD-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'AXD-ISAPI-4.0_32bit' - Path = '*.axd' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'AXD-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'AXD-ISAPI-4.0_64bit' - Path = '*.axd' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'CGI-exe' = New-Object PSObject -Property @{ - Name = 'CGI-exe' - Path = '*.exe' - Verb = '*' - Modules = 'CgiModule' - ResourceType = 'File' - RequireAccess = 'Execute' - AllowPathInfo = 'true' - } - - 'ClientLoggingHandler' = New-Object PSObject -Property @{ - Name = 'ClientLoggingHandler' - Path = '*.log' - Verb = 'POST' - Modules = 'ClientLoggingHandler' - ResourceType = 'Unspecified' - RequireAccess = 'None' - } - - 'cshtm-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'cshtm-Integrated-4.0' - Path = '*.cshtm' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.HttpForbiddenHandler' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'cshtm-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'cshtm-ISAPI-4.0_32bit' - Path = '*.cshtm' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'cshtm-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'cshtm-ISAPI-4.0_64bit' - Path = '*.cshtm' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'cshtml-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'cshtml-Integrated-4.0' - Path = '*.cshtml' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.HttpForbiddenHandler' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'cshtml-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'cshtml-ISAPI-4.0_32bit' - Path = '*.cshtml' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'cshtml-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'cshtml-ISAPI-4.0_64bit' - Path = '*.cshtml' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'ExtensionlessUrlHandler-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'ExtensionlessUrlHandler-Integrated-4.0' - Path = '*.' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.Handlers.TransferRequestHandler' - PreCondition = 'integratedMode,runtimeVersionv4.0' - ResponseBufferLimit = '0' - } - - 'ExtensionlessUrlHandler-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'ExtensionlessUrlHandler-ISAPI-4.0_32bit' - Path = '*.' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'ExtensionlessUrlHandler-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'ExtensionlessUrlHandler-ISAPI-4.0_64bit' - Path = '*.' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'HttpRemotingHandlerFactory-rem-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-rem-Integrated-4.0' - Path = '*.rem' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory,;System.Runtime.Remoting,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = b77a5c561934e089' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'HttpRemotingHandlerFactory-rem-Integrated' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-rem-Integrated' - Path = '*.rem' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory,;System.Runtime.Remoting,;Version = 2.0.0.0,;Culture = neutral,;PublicKeyToken = b77a5c561934e089' - PreCondition = 'integratedMode,runtimeVersionv2.0' - } - - 'HttpRemotingHandlerFactory-rem-ISAPI-2.0-64' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-rem-ISAPI-2.0-64' - Path = '*.rem' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness64' - ResponseBufferLimit = '0' - } - - 'HttpRemotingHandlerFactory-rem-ISAPI-2.0' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-rem-ISAPI-2.0' - Path = '*.rem' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness32' - ResponseBufferLimit = '0' - } - - 'HttpRemotingHandlerFactory-rem-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-rem-ISAPI-4.0_32bit' - Path = '*.rem' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'HttpRemotingHandlerFactory-rem-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-rem-ISAPI-4.0_64bit' - Path = '*.rem' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'HttpRemotingHandlerFactory-soap-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-soap-Integrated-4.0' - Path = '*.soap' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory,;System.Runtime.Remoting,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = b77a5c561934e089' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'HttpRemotingHandlerFactory-soap-Integrated' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-soap-Integrated' - Path = '*.soap' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory,;System.Runtime.Remoting,;Version = 2.0.0.0,;Culture = neutral,;PublicKeyToken = b77a5c561934e089' - PreCondition = 'integratedMode,runtimeVersionv2.0' - } - - 'HttpRemotingHandlerFactory-soap-ISAPI-2.0-64' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-soap-ISAPI-2.0-64' - Path = '*.soap' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness64' - ResponseBufferLimit = '0' - } - - 'HttpRemotingHandlerFactory-soap-ISAPI-2.0' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-soap-ISAPI-2.0' - Path = '*.soap' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness32' - ResponseBufferLimit = '0' - } - - 'HttpRemotingHandlerFactory-soap-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-soap-ISAPI-4.0_32bit' - Path = '*.soap' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'HttpRemotingHandlerFactory-soap-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'HttpRemotingHandlerFactory-soap-ISAPI-4.0_64bit' - Path = '*.soap' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'ISAPI-dll' = New-Object PSObject -Property @{ - Name = 'ISAPI-dll' - Path = '*.dll' - Verb = '*' - Modules = 'IsapiModule' - ResourceType = 'File' - RequireAccess = 'Execute' - AllowPathInfo = 'true' - } - - 'OPTIONSVerbHandler' = New-Object PSObject -Property @{ - Name = 'OPTIONSVerbHandler' - Path = '*' - Verb = 'OPTIONS' - Modules = 'ProtocolSupportModule' - RequireAccess = 'None' - } - - 'PageHandlerFactory-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'PageHandlerFactory-Integrated-4.0' - Path = '*.aspx' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.UI.PageHandlerFactory' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'PageHandlerFactory-Integrated' = New-Object PSObject -Property @{ - Name = 'PageHandlerFactory-Integrated' - Path = '*.aspx' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.UI.PageHandlerFactory' - PreCondition = 'integratedMode' - } - - 'PageHandlerFactory-ISAPI-2.0-64' = New-Object PSObject -Property @{ - Name = 'PageHandlerFactory-ISAPI-2.0-64' - Path = '*.aspx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness64' - ResponseBufferLimit = '0' - } - - 'PageHandlerFactory-ISAPI-2.0' = New-Object PSObject -Property @{ - Name = 'PageHandlerFactory-ISAPI-2.0' - Path = '*.aspx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness32' - ResponseBufferLimit = '0' - } - - 'PageHandlerFactory-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'PageHandlerFactory-ISAPI-4.0_32bit' - Path = '*.aspx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'PageHandlerFactory-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'PageHandlerFactory-ISAPI-4.0_64bit' - Path = '*.aspx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'rules-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'rules-Integrated-4.0' - Path = '*.rules' - Verb = '*' - Type = 'System.ServiceModel.Activation.ServiceHttpHandlerFactory,;System.ServiceModel.Activation,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = 31bf3856ad364e35' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'rules-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'rules-ISAPI-4.0_32bit' - Path = '*.rules' - Verb = '*' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'rules-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'rules-ISAPI-4.0_64bit' - Path = '*.rules' - Verb = '*' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'ScriptHandlerFactoryAppServices-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'ScriptHandlerFactoryAppServices-Integrated-4.0' - Path = '*_AppService.axd' - Verb = '*' - Type = 'System.Web.Script.Services.ScriptHandlerFactory,;System.Web.Extensions,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = 31BF3856AD364E35' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'ScriptResourceIntegrated-4.0' = New-Object PSObject -Property @{ - Name = 'ScriptResourceIntegrated-4.0' - Path = '*ScriptResource.axd' - Verb = 'GET,HEAD' - Type = 'System.Web.Handlers.ScriptResourceHandler,;System.Web.Extensions,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = 31BF3856AD364E35' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'SecurityCertificate' = New-Object PSObject -Property @{ - Name = 'SecurityCertificate' - Path = '*.cer' - Verb = 'GET,HEAD,POST' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\system32\inetsrv\asp.dll' - ResourceType = 'File' - } - - 'SimpleHandlerFactory-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'SimpleHandlerFactory-Integrated-4.0' - Path = '*.ashx' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.UI.SimpleHandlerFactory' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'SimpleHandlerFactory-Integrated' = New-Object PSObject -Property @{ - Name = 'SimpleHandlerFactory-Integrated' - Path = '*.ashx' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.UI.SimpleHandlerFactory' - PreCondition = 'integratedMode' - } - - 'SimpleHandlerFactory-ISAPI-2.0-64' = New-Object PSObject -Property @{ - Name = 'SimpleHandlerFactory-ISAPI-2.0-64' - Path = '*.ashx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness64' - ResponseBufferLimit = '0' - } - - 'SimpleHandlerFactory-ISAPI-2.0' = New-Object PSObject -Property @{ - Name = 'SimpleHandlerFactory-ISAPI-2.0' - Path = '*.ashx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness32' - ResponseBufferLimit = '0' - } - - 'SimpleHandlerFactory-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'SimpleHandlerFactory-ISAPI-4.0_32bit' - Path = '*.ashx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'SimpleHandlerFactory-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'SimpleHandlerFactory-ISAPI-4.0_64bit' - Path = '*.ashx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'SSINC-shtm' = New-Object PSObject -Property @{ - Name = 'SSINC-shtm' - Path = '*.shtm' - Verb = 'GET,HEAD,POST' - Modules = 'ServerSideIncludeModule' - ResourceType = 'File' - } - - 'SSINC-shtml' = New-Object PSObject -Property @{ - Name = 'SSINC-shtml' - Path = '*.shtml' - Verb = 'GET,HEAD,POST' - Modules = 'ServerSideIncludeModule' - ResourceType = 'File' - } - - 'SSINC-stm' = New-Object PSObject -Property @{ - Name = 'SSINC-stm' - Path = '*.stm' - Verb = 'GET,HEAD,POST' - Modules = 'ServerSideIncludeModule' - ResourceType = 'File' - } - - 'StaticFile' = New-Object PSObject -Property @{ - Name = 'StaticFile' - Path = '*' - Verb = '*' - Modules = 'StaticFileModule,DefaultDocumentModule,DirectoryListingModule' - ResourceType = 'Either' - RequireAccess = 'Read' - } - - 'svc-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'svc-Integrated-4.0' - Path = '*.svc' - Verb = '*' - Type = 'System.ServiceModel.Activation.ServiceHttpHandlerFactory,;System.ServiceModel.Activation,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = 31bf3856ad364e35' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'svc-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'svc-ISAPI-4.0_32bit' - Path = '*.svc' - Verb = '*' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'svc-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'svc-ISAPI-4.0_64bit' - Path = '*.svc' - Verb = '*' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'TraceHandler-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'TraceHandler-Integrated-4.0' - Path = 'trace.axd' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.Handlers.TraceHandler' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'TraceHandler-Integrated' = New-Object PSObject -Property @{ - Name = 'TraceHandler-Integrated' - Path = 'trace.axd' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.Handlers.TraceHandler' - PreCondition = 'integratedMode' - } - - 'TRACEVerbHandler' = New-Object PSObject -Property @{ - Name = 'TRACEVerbHandler' - Path = '*' - Verb = 'TRACE' - Modules = 'ProtocolSupportModule' - RequireAccess = 'None' - } - - 'vbhtm-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'vbhtm-Integrated-4.0' - Path = '*.vbhtm' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.HttpForbiddenHandler' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'vbhtm-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'vbhtm-ISAPI-4.0_32bit' - Path = '*.vbhtm' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'vbhtm-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'vbhtm-ISAPI-4.0_64bit' - Path = '*.vbhtm' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'vbhtml-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'vbhtml-Integrated-4.0' - Path = '*.vbhtml' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.HttpForbiddenHandler' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'vbhtml-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'vbhtml-ISAPI-4.0_32bit' - Path = '*.vbhtml' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'vbhtml-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'vbhtml-ISAPI-4.0_64bit' - Path = '*.vbhtml' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'WebAdminHandler-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'WebAdminHandler-Integrated-4.0' - Path = 'WebAdmin.axd' - Verb = 'GET,DEBUG' - Type = 'System.Web.Handlers.WebAdminHandler' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'WebAdminHandler-Integrated' = New-Object PSObject -Property @{ - Name = 'WebAdminHandler-Integrated' - Path = 'WebAdmin.axd' - Verb = 'GET,DEBUG' - Type = 'System.Web.Handlers.WebAdminHandler' - PreCondition = 'integratedMode' - } - - 'WebDAV' = New-Object PSObject -Property @{ - Name = 'WebDAV' - Path = '*' - Verb = 'PROPFIND,PROPPATCH,MKCOL,PUT,COPY,DELETE,MOVE,LOCK,UNLOCK' - Modules = 'WebDAVModule' - ResourceType = 'Unspecified' - RequireAccess = 'None' - } - - 'WebServiceHandlerFactory-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'WebServiceHandlerFactory-Integrated-4.0' - Path = '*.asmx' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.Script.Services.ScriptHandlerFactory,;System.Web.Extensions,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = 31bf3856ad364e35' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'WebServiceHandlerFactory-Integrated' = New-Object PSObject -Property @{ - Name = 'WebServiceHandlerFactory-Integrated' - Path = '*.asmx' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Web.Services.Protocols.WebServiceHandlerFactory,;System.Web.Services,;Version = 2.0.0.0,;Culture = neutral,;PublicKeyToken = b03f5f7f11d50a3a' - PreCondition = 'integratedMode,runtimeVersionv2.0' - } - - 'WebServiceHandlerFactory-ISAPI-2.0-64' = New-Object PSObject -Property @{ - Name = 'WebServiceHandlerFactory-ISAPI-2.0-64' - Path = '*.asmx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness64' - ResponseBufferLimit = '0' - } - - 'WebServiceHandlerFactory-ISAPI-2.0' = New-Object PSObject -Property @{ - Name = 'WebServiceHandlerFactory-ISAPI-2.0' - Path = '*.asmx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv2.0,bitness32' - ResponseBufferLimit = '0' - } - - 'WebServiceHandlerFactory-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'WebServiceHandlerFactory-ISAPI-4.0_32bit' - Path = '*.asmx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'WebServiceHandlerFactory-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'WebServiceHandlerFactory-ISAPI-4.0_64bit' - Path = '*.asmx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'xamlx-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'xamlx-Integrated-4.0' - Path = '*.xamlx' - Verb = 'GET,HEAD,POST,DEBUG' - Type = 'System.Xaml.Hosting.XamlHttpHandlerFactory,;System.Xaml.Hosting,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = 31bf3856ad364e35' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'xamlx-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'xamlx-ISAPI-4.0_32bit' - Path = '*.xamlx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'xamlx-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'xamlx-ISAPI-4.0_64bit' - Path = '*.xamlx' - Verb = 'GET,HEAD,POST,DEBUG' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } - - 'xoml-Integrated-4.0' = New-Object PSObject -Property @{ - Name = 'xoml-Integrated-4.0' - Path = '*.xoml' - Verb = '*' - Type = 'System.ServiceModel.Activation.ServiceHttpHandlerFactory,;System.ServiceModel.Activation,;Version = 4.0.0.0,;Culture = neutral,;PublicKeyToken = 31bf3856ad364e35' - PreCondition = 'integratedMode,runtimeVersionv4.0' - } - - 'xoml-ISAPI-4.0_32bit' = New-Object PSObject -Property @{ - Name = 'xoml-ISAPI-4.0_32bit' - Path = '*.xoml' - Verb = '*' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness32' - ResponseBufferLimit = '0' - } - - 'xoml-ISAPI-4.0_64bit' = New-Object PSObject -Property @{ - Name = 'xoml-ISAPI-4.0_64bit' - Path = '*.xoml' - Verb = '*' - Modules = 'IsapiModule' - ScriptProcessor = '%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll' - PreCondition = 'classicMode,runtimeVersionv4.0,bitness64' - ResponseBufferLimit = '0' - } -} - -#endregion -function Get-TargetResource -{ - <# - .SYNOPSIS - This will return a hashtable of results - #> - - [OutputType([Hashtable])] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [String] $Name, - - [Parameter(Mandatory = $true)] - [ValidateSet('Present', 'Absent')] - [String] $Ensure - ) - - # Check if WebAdministration module is present for IIS cmdlets - Assert-Module - - $handler = Get-Handler -Name $Name - - if ($null -eq $handler) - { - Write-Verbose -Message $script:localizedData.VerboseGetTargetAbsent - return @{ - Ensure = 'Absent' - Name = $Name - } - } - else - { - Write-Verbose -Message $script:localizedData.VerboseGetTargetPresent - return @{ - Ensure = 'Present' - Name = $Name - } - } -} -function Set-TargetResource -{ - <# - .SYNOPSIS - This will set the desired state - - .NOTES - There are a few limitations with this resource: - It only supports builtin handlers, that come with IIS, not third party ones. - Removing handlers should be no problem, but all new handlers are added at the - top of the list, meaning, they are tried first. There is no way of ordering the - handler list except for removing all and then adding them in the correct order. - #> - - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [String] $Name, - - [Parameter(Mandatory = $true)] - [ValidateSet('Present', 'Absent')] - [String] $Ensure - ) - - Assert-Module - - [String] $psPathRoot = 'MACHINE/WEBROOT/APPHOST' - [String] $sectionNode = 'system.webServer/handlers' - - $handler = Get-Handler -Name $Name - - if ($null -eq $handler -and $Ensure -eq 'Present') - { - # add the handler - Add-Handler -Name $Name - Write-Verbose -Message ($script:localizedData.AddingHandler -f $Name) - } - elseif ($null -ne $handler -and $Ensure -eq 'Absent') - { - # remove the handler - Remove-WebConfigurationProperty -PSPath $psPathRoot ` - -Filter $sectionNode ` - -Name '.' ` - -AtElement @{ - name = "$Name" - } - Write-Verbose -Message ($script:localizedData.RemovingHandler -f $Name) - } -} -function Test-TargetResource -{ - <# - .SYNOPSIS - This tests the desired state. If the state is not correct it will return $false. - If the state is correct it will return $true - #> - - [OutputType([System.Boolean])] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [String] $Name, - - [Parameter(Mandatory = $true)] - [ValidateSet('Present', 'Absent')] - [String] $Ensure - ) - - Assert-Module - - $handler = Get-Handler -Name $Name - - if (($null -eq $handler -and $Ensure -eq 'Present') -or ` - ($null -ne $handler -and $Ensure -eq 'Absent')) - { - return $false - } - elseif ($null -ne $handler -and $Ensure -eq 'Present') - { - # Handler is present - Write-Verbose -Message ($script:localizedData.HandlerExists -f $Name) - return $true - } - else - { - # Handler not present and should not be there. - Write-Verbose -Message ($script:localizedData.HandlerNotPresent -f $Name) - return $true - } -} - -#region Helper Functions - -function Get-Handler -{ - param - ( - [Parameter()] - [String] $Name - ) - - [String] $filter = "system.webServer/handlers/Add[@Name='" + $Name + "']" - return Get-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' ` - -Filter $filter ` - -Name '.' -} - -function Add-Handler -{ - param - ( - [Parameter()] - [String] $Name - ) - - # check whether our dictionary has an item with the specified key - if ($script:handlers.ContainsKey($Name)) - { - # add the new handler - Add-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' ` - -Filter 'system.webServer/handlers' ` - -Name '.' ` - -Value $script:handlers[$Name] - } - else - { - New-TerminatingError -ErrorId 'HandlerNotSupported' ` - -ErrorMessage $($script:localizedData.HandlerNotSupported -f $Name) ` - -ErrorCategory InvalidArgument - } -} - -#endregion - -Export-ModuleMember -Function *-TargetResource diff --git a/source/DSCResources/MSFT_xIIsHandler/MSFT_xIisHandler.schema.mof b/source/DSCResources/MSFT_xIIsHandler/MSFT_xIisHandler.schema.mof deleted file mode 100644 index 854438405..000000000 --- a/source/DSCResources/MSFT_xIIsHandler/MSFT_xIisHandler.schema.mof +++ /dev/null @@ -1,6 +0,0 @@ -[ClassVersion("1.0.0"), FriendlyName("xIisHandler")] -class MSFT_xIisHandler : OMI_BaseResource -{ - [Key, Description("The name of the handler, for example 'PageHandlerFactory-Integrated-4.0'")] string Name; - [Required, Description("Ensures that the handler is Present or Absent. Defaults to Present."), ValueMap{"Present", "Absent"}, Values{"Present", "Absent"}] string Ensure; -}; diff --git a/source/DSCResources/MSFT_xIIsHandler/README.md b/source/DSCResources/MSFT_xIIsHandler/README.md deleted file mode 100644 index 9aca5a072..000000000 --- a/source/DSCResources/MSFT_xIIsHandler/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Description - -> Please use WebApplicationHandler resource instead. xIISHandler will be removed in future release. - -## Requirements - -* Target machine must be running Windows Server 2012 R2 or later. - -## Known issues - -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xIisHandler). diff --git a/source/DSCResources/MSFT_xIIsHandler/en-US/MSFT_xIIsHandler.strings.psd1 b/source/DSCResources/MSFT_xIIsHandler/en-US/MSFT_xIIsHandler.strings.psd1 deleted file mode 100644 index cafb6b4d2..000000000 --- a/source/DSCResources/MSFT_xIIsHandler/en-US/MSFT_xIIsHandler.strings.psd1 +++ /dev/null @@ -1,9 +0,0 @@ -ConvertFrom-StringData @' - AddingHandler = Adding handler '{0}'. - RemovingHandler = Removing handler '{0}'. - HandlerExists = Handler with name '{0}' already exist. - HandlerNotPresent = Handler with name '{0}' is not present as requested. - HandlerNotSupported = Handler with name '{0}' is not supported. - VerboseGetTargetPresent = Handler is Present. - VerboseGetTargetAbsent = Handler is Absent. -'@ diff --git a/source/DSCResources/MSFT_xIisModule/xIisModuleDesigner.ps1 b/source/DSCResources/MSFT_xIisModule/xIisModuleDesigner.ps1 deleted file mode 100644 index 02a12d4a6..000000000 --- a/source/DSCResources/MSFT_xIisModule/xIisModuleDesigner.ps1 +++ /dev/null @@ -1,50 +0,0 @@ -$diff = join-Path ${env:ProgramFiles(x86)} "Beyond compare 2\bc2.exe" -$friendlyName = "xIisModule" -$resourceName = "MSFT_$friendlyName" -$classVersion = "1.0.0" - -$scriptRoot = Split-Path $MyInvocation.MyCommand.Path -$originalModuleRoot = join-Path $scriptroot "..\.." -$originalModuleRootPath = Resolve-Path $originalModuleRoot -$moduleRoot = Join-Path $env:temp "$($originalModuleRootPath.path | split-path -Leaf)Temp" - -$resources = @() - -#Key properties -$resources += New-xDscResourceProperty -Name Path -Type String -Attribute Key -Description "The path to the module, usually a dll, to be added to IIS." - - -#Required Properites -$resources += New-xDscResourceProperty -Name Name -Type String -Attribute Required -Description "The logical name of the module to add to IIS." -$resources += New-xDscResourceProperty -Name RequestPath -Type String -Attribute Required -Description "The allowed request Path example: *.php" -$resources += New-xDscResourceProperty -Name Verb -Type String[] -Attribute Required -Description "The supported verbs for the module." - -#Write Properties -$resources += New-xDscResourceProperty -Name SiteName -Type String -Attribute Write -Description "The IIS Site to register the module." -$resources += New-xDscResourceProperty -Name Ensure -Type String -Attribute Write -Description "Should the module be present or absent." -ValidateSet @("Present","Absent") -$resources += New-xDscResourceProperty -Name ModuleType -Type String -Attribute Write -Description "The type of the module." -ValidateSet @("FastCgiModule") - -#Read Properties -$resources += New-xDscResourceProperty -Name EndPointSetup -Type Boolean -Attribute Read -Description "The End Point is setup. Such as a Fast Cgi endpoint." - - - -Write-Verbose "updating..." -Verbose - -# Create a New template resource to a temporary folder -New-xDscResource -Property $resources -ClassVersion $classVersion -Name $resourceName -Path $moduleRoot -FriendlyName $friendlyName - - -# Use your favorite diff program to compare and merge the current resource and the existing resource - -if ((test-Path $diff)) -{ - &$diff $originalModuleRoot $moduleRoot -} -else -{ - Write-Warning "Diff propgram not found!`r`nUse your favorite diff program to compare and merge:`r`n `t$($originalModuleRootPath.path)`r`n and:`r`n `t$moduleRoot" -} - - - diff --git a/source/DSCResources/MSFT_xWebAppPoolDefaults/README.md b/source/DSCResources/MSFT_xWebAppPoolDefaults/README.md deleted file mode 100644 index e6d459c5a..000000000 --- a/source/DSCResources/MSFT_xWebAppPoolDefaults/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Description - -The `xWebAppPoolDefaults` DSC resource is used to... - -## Requirements - -* Target machine must be running Windows Server 2012 R2 or later. - -## Known issues - -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebAppPoolDefaults). diff --git a/source/DSCResources/MSFT_xWebConfigKeyValue/MSFT_xWebConfigKeyValue.psm1 b/source/DSCResources/MSFT_xWebConfigKeyValue/MSFT_xWebConfigKeyValue.psm1 deleted file mode 100644 index 16943f05e..000000000 --- a/source/DSCResources/MSFT_xWebConfigKeyValue/MSFT_xWebConfigKeyValue.psm1 +++ /dev/null @@ -1,418 +0,0 @@ -$script:resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$script:modulesFolderPath = Join-Path -Path $script:resourceModulePath -ChildPath 'Modules' -$script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -ChildPath 'xWebAdministration.Common' - -Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1') - -# Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebConfigKeyValue' - -<# - .SYNOPSIS - Gets the value of the specified key in the config file -#> -function Get-TargetResource -{ - [CmdletBinding()] - [OutputType([System.Collections.Hashtable])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] $WebsitePath, - - [Parameter(Mandatory = $true)] - [ValidateSet('AppSettings')] - [System.String] $ConfigSection, - - [Parameter(Mandatory = $true)] - [String] $Key - ) - - Write-Verbose ` - -Message ($script:localizedData.VerboseGetTargetCheckingTarget -f $Key, $ConfigSection, $WebsitePath ) - - $existingValue = Get-ItemValue ` - -Key $Key ` - -IsAttribute $false ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - - if ( $null -eq $existingValue ) - { - Write-Verbose ` - -Message ($script:localizedData.VerboseGetTargetAttributeCheck -f $Key ) - - $existingValue = Get-ItemValue ` - -Key $Key ` - -IsAttribute $true ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - } - - if ( $existingValue.Length -eq 0 ) - { - Write-Verbose ` - -Message ($script:localizedData.VerboseGetTargetKeyNotFound -f $Key ) - - return @{ - Ensure = 'Absent' - Key = $Key - Value = $existingValue - } - } - - Write-Verbose ` - -Message ($script:localizedData.VerboseGetTargetKeyFound -f $Key ) - - return @{ - Ensure = 'Present' - Key = $Key - Value = $existingValue - } -} - -<# - .SYNOPSIS - Sets the value of the specified key in the config file -#> -function Set-TargetResource -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [System.String] $WebsitePath, - - [Parameter(Mandatory = $true)] - [ValidateSet('AppSettings')] - [System.String] $ConfigSection, - - [Parameter(Mandatory = $true)] - [String] $Key, - - [Parameter()] - [ValidateSet('Present','Absent')] - [System.String] $Ensure = 'Present', - - [Parameter()] - [String] $Value, - - [Parameter()] - [System.Boolean] $IsAttribute - ) - - if ($Ensure -eq 'Present') - { - Write-Verbose ` - -Message ($script:localizedData.VerboseSetTargetCheckingKey -f $Key ) - - $existingValue = Get-ItemValue ` - -Key $Key ` - -IsAttribute $IsAttribute ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - - if ( (-not $IsAttribute -and ($null -eq $existingValue) ) ` - -or ( $IsAttribute -and ($existingValue.Length -eq 0) ) ) - { - Write-Verbose ` - -Message ($script:localizedData.VerboseSetTargetAddItem -f $Key ) - - Add-Item ` - -Key $Key ` - -Value $Value ` - -IsAttribute $IsAttribute ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - } - else - { - $propertyName = 'value' - - if ( $IsAttribute ) - { - $propertyName = $Key - } - - Write-Verbose ` - -Message ($script:localizedData.VerboseSetTargetEditItem -f $Key ) - - Edit-Item ` - -PropertyName $propertyName ` - -OldValue $Key ` - -NewValue $Value ` - -IsAttribute $IsAttribute ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - } - } - else - { - Write-Verbose ` - -Message ($script:localizedData.VerboseSetTargetRemoveItem -f $Key ) - - Remove-Item ` - -Key $Key ` - -IsAttribute $IsAttribute ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - } -} - -<# - .SYNOPSIS - Tests the value of the specified key in the config file -#> -function Test-TargetResource -{ - [CmdletBinding()] - [OutputType([System.Boolean])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] $WebsitePath, - - [Parameter(Mandatory = $true)] - [ValidateSet('AppSettings')] - [System.String] $ConfigSection, - - [Parameter(Mandatory = $true)] - [String] $Key, - - [Parameter()] - [String] $Value, - - [Parameter()] - [ValidateSet('Present','Absent')] - [System.String] $Ensure = 'Present', - - [Parameter()] - [System.Boolean] $IsAttribute - ) - - if ( -not $PSBoundParameters.ContainsKey('IsAttribute') ) - { - $IsAttribute = $false - } - - Write-Verbose ` - -Message ($script:localizedData.VerboseTestTargetCheckingTarget -f $Key, $ConfigSection, $WebsitePath ) - - $existingValue = Get-ItemValue ` - -Key $Key ` - -IsAttribute $IsAttribute ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - - if ( $Ensure -eq 'Present' ) - { - if ( ( $null -eq $existingValue ) -or ( $existingValue -ne $Value ) ` - -or ($existingValue.Length -eq 0) ) - { - Write-Verbose ` - -Message ($script:localizedData.VerboseTestTargetKeyNotFound -f $Key ) - return $false - } - } - else - { - if ( ( $null -ne $existingValue ) -or ( $existingValue.Length -ne 0 ) ) - { - Write-Verbose ` - -Message ($script:localizedData.VerboseTestTargetKeyNotFound -f $Key ) - - return $false - } - } - - Write-Verbose ` - -Message ($script:localizedData.VerboseTestTargetKeyWasFound -f $Key) - - return $true -} - -# region Helper Functions - -function Add-Item -{ - param - ( - [Parameter()] - [string] $Key, - - [Parameter()] - [string] $Value, - - [Parameter()] - [Boolean] $isAttribute, - - [Parameter()] - [string] $WebsitePath, - - [Parameter()] - [string] $ConfigSection - ) - - $itemCollection = @{ - Key = $Key; - Value = $Value; - } - - if ( -not $isAttribute ) - { - Add-WebConfigurationProperty ` - -Filter $ConfigSection ` - -Name '.' ` - -Value $itemCollection ` - -PSPath $WebsitePath - } - else - { - Set-WebConfigurationProperty ` - -Filter $ConfigSection ` - -PSPath $WebsitePath ` - -Name $Key ` - -Value $Value ` - -WarningAction Stop - } -} - -function Edit-Item -{ - param - ( - [Parameter()] - [string] $PropertyName, - - [Parameter()] - [string] $OldValue, - - [Parameter()] - [string] $NewValue, - - [Parameter()] - [Boolean] $IsAttribute, - - [Parameter()] - [string] $WebsitePath, - - [Parameter()] - [string] $ConfigSection - ) - - if ( -not $IsAttribute ) - { - $filter = "$ConfigSection/add[@key=`'$OldValue`']" - - Set-WebConfigurationProperty -Filter $filter ` - -PSPath $WebsitePath ` - -Name $PropertyName ` - -Value $NewValue ` - -WarningAction Stop - } - else - { - Set-WebConfigurationProperty ` - -Filter $ConfigSection ` - -PSPath $WebsitePath ` - -Name $PropertyName ` - -Value $NewValue ` - -WarningAction Stop - } -} - -function Remove-Item -{ - param - ( - [Parameter()] - [string] $Key, - - [Parameter()] - [Boolean] $IsAttribute, - - [Parameter()] - [string] $WebsitePath, - - [Parameter()] - [string] $ConfigSection - ) - - if ( -not $isAttribute ) - { - $filter = "$ConfigSection/add[@key=`'$key`']" - Clear-WebConfiguration ` - -Filter $filter ` - -PSPath $WebsitePath ` - -WarningAction Stop - } - else - { - $filter = "$ConfigSection/@$key" - - <# - This is a workaround to ensure if appSettings has no collection - and we try to delete the only attribute, the entire node is not deleted. - if we try removing the only attribute even if there is one collection item, - the node is preserved. - #> - Add-Item ` - -Key 'dummyKey' ` - -Value 'dummyValue' ` - -IsAttribute $false ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - - Clear-WebConfiguration ` - -Filter $filter ` - -PSPath $WebsitePath ` - -WarningAction Stop - - Remove-Item ` - -Key 'dummyKey' ` - -IsAttribute $false ` - -WebsitePath $WebsitePath ` - -ConfigSection $ConfigSection - } -} - -function Get-ItemValue -{ - param - ( - [Parameter()] - [string] $Key, - - [Parameter()] - [Boolean] $isAttribute, - - [Parameter()] - [string] $WebsitePath, - - # If this is null $value.Value will be null - [Parameter()] - [string] $ConfigSection - ) - - if (-not $isAttribute) - { - $filter = "$ConfigSection/add[@key=`'$key`']" - $value = Get-WebConfigurationProperty ` - -Filter $filter ` - -Name 'value' ` - -PSPath $WebsitePath - } - else - { - $value = Get-WebConfigurationProperty ` - -Filter $ConfigSection ` - -Name "$Key" ` - -PSPath $WebsitePath - } - - return $value.Value -} - -# endregion - -Export-ModuleMember -Function *-TargetResource diff --git a/source/DSCResources/MSFT_xWebConfigKeyValue/MSFT_xWebConfigKeyValue.schema.mof b/source/DSCResources/MSFT_xWebConfigKeyValue/MSFT_xWebConfigKeyValue.schema.mof deleted file mode 100644 index e0c9c47f8..000000000 --- a/source/DSCResources/MSFT_xWebConfigKeyValue/MSFT_xWebConfigKeyValue.schema.mof +++ /dev/null @@ -1,10 +0,0 @@ -[ClassVersion("1.0.0.0"), FriendlyName("xWebConfigKeyValue")] -class MSFT_xWebConfigKeyValue : OMI_BaseResource -{ - [Key, Description("Path to website location(IIS or WebAdministration format)")] String WebsitePath; - [Key, Description("Config Section to be update"), ValueMap{"AppSettings"}, Values{"AppSettings"}] String ConfigSection; - [Key, Description("Key for AppSettings")] String Key; - [Write, Description("Indicates if the property and value should be present or absent. Defaults to Present."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; - [Write, Description("Value for AppSettings")] String Value; - [Write, Description("If the given key value pair is for attribute, default is element")] Boolean IsAttribute; -}; diff --git a/source/DSCResources/MSFT_xWebConfigKeyValue/README.md b/source/DSCResources/MSFT_xWebConfigKeyValue/README.md deleted file mode 100644 index 004702f3b..000000000 --- a/source/DSCResources/MSFT_xWebConfigKeyValue/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Description - ->NOTE: The **xWebConfigKeyValue** resource is deprecated and has been replaced by the **xWebConfigProperty** and **xWebConfigPropertyCollection** resources. ->It may be removed in a future release. - -## Requirements - -* Target machine must be running Windows Server 2012 R2 or later. - -## Known issues - -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebConfigKeyValue). diff --git a/source/DSCResources/MSFT_xWebConfigKeyValue/en-US/MSFT_xWebConfigKeyValue.strings.psd1 b/source/DSCResources/MSFT_xWebConfigKeyValue/en-US/MSFT_xWebConfigKeyValue.strings.psd1 deleted file mode 100644 index 3c25b3700..000000000 --- a/source/DSCResources/MSFT_xWebConfigKeyValue/en-US/MSFT_xWebConfigKeyValue.strings.psd1 +++ /dev/null @@ -1,14 +0,0 @@ -# culture="en-US" -ConvertFrom-StringData -StringData @' - VerboseGetTargetCheckingTarget = Checking for the existance of key "{0}" in ConfigSection "{1}" located at "{2}" - VerboseGetTargetAttributeCheck = Checking if key "{0}" is an Attribute - VerboseGetTargetKeyNotFound = Key "{0}" has not been found. - VerboseGetTargetKeyFound = Key "{0}" has been found - VerboseSetTargetCheckingKey = Checking for existance of key "{0}" - VerboseSetTargetAddItem = Key "{0}" does not exist, adding key - VerboseSetTargetEditItem = Key "{0}" exists, editing key - VerboseSetTargetRemoveItem = Key "{0}" exists, removing key - VerboseTestTargetCheckingTarget = Checking for the existance of key "{0}" in ConfigSection "{1}" located at "{2}" - VerboseTestTargetKeyNotFound = Key "{0}" has not been found. - VerboseTestTargetKeyWasFound = Key "{0}" has been found. -'@ diff --git a/source/DSCResources/MSFT_xWebSiteDefaults/README.md b/source/DSCResources/MSFT_xWebSiteDefaults/README.md deleted file mode 100644 index 89e09e022..000000000 --- a/source/DSCResources/MSFT_xWebSiteDefaults/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Description - -The `xWebSiteDefaults` DSC resource is used to... - -## Requirements - -* Target machine must be running Windows Server 2012 R2 or later. - -## Known issues - -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebSiteDefaults). diff --git a/source/DSCResources/MSFT_xWebVirtualDirectory/README.md b/source/DSCResources/MSFT_xWebVirtualDirectory/README.md deleted file mode 100644 index 2ae335f52..000000000 --- a/source/DSCResources/MSFT_xWebVirtualDirectory/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Description - -The `xWebVirtualDirectory` DSC resource is used to... - -## Requirements - -* Target machine must be running Windows Server 2012 R2 or later. - -## Known issues - -All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/xWebAdministration/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+xWebVirtualDirectory). diff --git a/source/Examples/Resources/xIisFeatureDelegation/Sample_xIisFeatureDelegation_IisConfigurationPathFormat.ps1 b/source/Examples/Resources/IisFeatureDelegation/Sample_IisFeatureDelegation_IisConfigurationPathFormat.ps1 similarity index 86% rename from source/Examples/Resources/xIisFeatureDelegation/Sample_xIisFeatureDelegation_IisConfigurationPathFormat.ps1 rename to source/Examples/Resources/IisFeatureDelegation/Sample_IisFeatureDelegation_IisConfigurationPathFormat.ps1 index 9fe875d92..5e5e09cb8 100644 --- a/source/Examples/Resources/xIisFeatureDelegation/Sample_xIisFeatureDelegation_IisConfigurationPathFormat.ps1 +++ b/source/Examples/Resources/IisFeatureDelegation/Sample_IisFeatureDelegation_IisConfigurationPathFormat.ps1 @@ -13,7 +13,7 @@ configuration Example $NodeName = 'localhost' ) - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Import-DscResource -Module PSDesiredStateConfiguration Node $NodeName @@ -26,21 +26,21 @@ configuration Example } # Allow Write access to some section that normally don't have it. - xIisFeatureDelegation serverRuntime + IisFeatureDelegation serverRuntime { Filter = '/system.webserver/serverRuntime' OverrideMode = 'Allow' Path = 'MACHINE/WEBROOT/APPHOST' } - xIisFeatureDelegation anonymousAuthentication + IisFeatureDelegation anonymousAuthentication { Filter = '/system.webserver/security/authentication/anonymousAuthentication' OverrideMode = 'Allow' Path = 'MACHINE/WEBROOT/APPHOST' } - xIisFeatureDelegation sessionState + IisFeatureDelegation sessionState { Filter = '/system.web/sessionState' OverrideMode = 'Allow' diff --git a/source/Examples/Resources/xIisFeatureDelegation/Sample_xIisFeatureDelegation_IisModulePathFormat.ps1 b/source/Examples/Resources/IisFeatureDelegation/Sample_IisFeatureDelegation_IisModulePathFormat.ps1 similarity index 86% rename from source/Examples/Resources/xIisFeatureDelegation/Sample_xIisFeatureDelegation_IisModulePathFormat.ps1 rename to source/Examples/Resources/IisFeatureDelegation/Sample_IisFeatureDelegation_IisModulePathFormat.ps1 index 4d4809cda..c1cfcc673 100644 --- a/source/Examples/Resources/xIisFeatureDelegation/Sample_xIisFeatureDelegation_IisModulePathFormat.ps1 +++ b/source/Examples/Resources/IisFeatureDelegation/Sample_IisFeatureDelegation_IisModulePathFormat.ps1 @@ -13,7 +13,7 @@ configuration Example $NodeName = 'localhost' ) - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Import-DscResource -Module PSDesiredStateConfiguration Node $NodeName @@ -26,21 +26,21 @@ configuration Example } # Allow Write access to some section that normally don't have it. - xIisFeatureDelegation serverRuntime + IisFeatureDelegation serverRuntime { Filter = '/system.webserver/serverRuntime' OverrideMode = 'Allow' Path = 'IIS:\Sites\Default Web Site' } - xIisFeatureDelegation anonymousAuthentication + IisFeatureDelegation anonymousAuthentication { Filter = '/system.webserver/security/authentication/anonymousAuthentication' OverrideMode = 'Allow' Path = 'IIS:\Sites\Default Web Site' } - xIisFeatureDelegation sessionState + IisFeatureDelegation sessionState { Filter = '/system.web/sessionState' OverrideMode = 'Allow' diff --git a/source/Examples/Resources/xIisLogging/Sample_xIisLogging_LogFlags.ps1 b/source/Examples/Resources/IisLogging/Sample_IisLogging_LogFlags.ps1 similarity index 77% rename from source/Examples/Resources/xIisLogging/Sample_xIisLogging_LogFlags.ps1 rename to source/Examples/Resources/IisLogging/Sample_IisLogging_LogFlags.ps1 index cd6e16ed4..57f0d3bf2 100644 --- a/source/Examples/Resources/xIisLogging/Sample_xIisLogging_LogFlags.ps1 +++ b/source/Examples/Resources/IisLogging/Sample_IisLogging_LogFlags.ps1 @@ -1,4 +1,4 @@ -configuration Sample_xIisLogging_LogFlags +configuration Sample_IisLogging_LogFlags { param ( @@ -7,11 +7,11 @@ configuration Sample_xIisLogging_LogFlags ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { - xIisLogging Logging + IisLogging Logging { LogPath = 'C:\IISLogFiles' Logflags = @('Date', 'Time', 'ClientIP', 'ServerIP', 'UserAgent') diff --git a/source/Examples/Resources/xIisLogging/Sample_xIisLogging_Rollover.ps1 b/source/Examples/Resources/IisLogging/Sample_IisLogging_Rollover.ps1 similarity index 80% rename from source/Examples/Resources/xIisLogging/Sample_xIisLogging_Rollover.ps1 rename to source/Examples/Resources/IisLogging/Sample_IisLogging_Rollover.ps1 index 70c21f163..db46ea58e 100644 --- a/source/Examples/Resources/xIisLogging/Sample_xIisLogging_Rollover.ps1 +++ b/source/Examples/Resources/IisLogging/Sample_IisLogging_Rollover.ps1 @@ -1,4 +1,4 @@ -configuration Sample_xIisLogging_Rollover +configuration Sample_IisLogging_Rollover { param ( @@ -7,11 +7,11 @@ configuration Sample_xIisLogging_Rollover ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { - xIisLogging Logging + IisLogging Logging { LogPath = 'C:\IISLogFiles' Logflags = @('Date', 'Time', 'ClientIP', 'UserName', 'ServerIP') diff --git a/source/Examples/Resources/xIisLogging/Sample_xIisLogging_Truncate.ps1 b/source/Examples/Resources/IisLogging/Sample_IisLogging_Truncate.ps1 similarity index 80% rename from source/Examples/Resources/xIisLogging/Sample_xIisLogging_Truncate.ps1 rename to source/Examples/Resources/IisLogging/Sample_IisLogging_Truncate.ps1 index 4f1156eb0..de9675a80 100644 --- a/source/Examples/Resources/xIisLogging/Sample_xIisLogging_Truncate.ps1 +++ b/source/Examples/Resources/IisLogging/Sample_IisLogging_Truncate.ps1 @@ -1,4 +1,4 @@ -configuration Sample_xIisLogging_Truncate +configuration Sample_IisLogging_Truncate { param ( @@ -7,11 +7,11 @@ configuration Sample_xIisLogging_Truncate ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { - xIisLogging Logging + IisLogging Logging { LogPath = 'C:\IISLogFiles' Logflags = @('Date', 'Time', 'ClientIP', 'UserName', 'ServerIP') diff --git a/source/Examples/Resources/xIisMimeTypeMapping/Sample_xIisMimeTypeMapping_RemoveVideo.ps1 b/source/Examples/Resources/IisMimeTypeMapping/Sample_IisMimeTypeMapping_RemoveVideo.ps1 similarity index 86% rename from source/Examples/Resources/xIisMimeTypeMapping/Sample_xIisMimeTypeMapping_RemoveVideo.ps1 rename to source/Examples/Resources/IisMimeTypeMapping/Sample_IisMimeTypeMapping_RemoveVideo.ps1 index 98a931054..f953920f3 100644 --- a/source/Examples/Resources/xIisMimeTypeMapping/Sample_xIisMimeTypeMapping_RemoveVideo.ps1 +++ b/source/Examples/Resources/IisMimeTypeMapping/Sample_IisMimeTypeMapping_RemoveVideo.ps1 @@ -1,4 +1,4 @@ -configuration Sample_xIisMimeTypeMapping_RemoveVideo +configuration Sample_IisMimeTypeMapping_RemoveVideo { param ( @@ -12,7 +12,7 @@ configuration Sample_xIisMimeTypeMapping_RemoveVideo ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration + Import-DscResource -Module WebAdministrationDsc, PSDesiredStateConfiguration Node $NodeName { @@ -24,7 +24,7 @@ configuration Sample_xIisMimeTypeMapping_RemoveVideo } # Remove a bunch of Video Mime Type mappings - xIisMimeTypeMapping Mp2 + IisMimeTypeMapping Mp2 { Ensure = 'Absent' Extension = '.mp2' @@ -33,7 +33,7 @@ configuration Sample_xIisMimeTypeMapping_RemoveVideo DependsOn = '[WindowsFeature]IIS' } - xIisMimeTypeMapping Mp4 + IisMimeTypeMapping Mp4 { Ensure = 'Absent' Extension = '.mp4' @@ -42,7 +42,7 @@ configuration Sample_xIisMimeTypeMapping_RemoveVideo DependsOn = '[WindowsFeature]IIS' } - xIisMimeTypeMapping Mpeg + IisMimeTypeMapping Mpeg { Ensure = 'Absent' Extension = '.mpeg' @@ -52,7 +52,7 @@ configuration Sample_xIisMimeTypeMapping_RemoveVideo } # we only allow the mpg Video extension on our server - xIisMimeTypeMapping Mpg + IisMimeTypeMapping Mpg { Ensure = 'Present' Extension = '.mpg' diff --git a/source/Examples/Resources/Sample_EndToEndxWebAdministration.ps1 b/source/Examples/Resources/Sample_EndToEndWebAdministration.ps1 similarity index 71% rename from source/Examples/Resources/Sample_EndToEndxWebAdministration.ps1 rename to source/Examples/Resources/Sample_EndToEndWebAdministration.ps1 index 472308d08..0c9512869 100644 --- a/source/Examples/Resources/Sample_EndToEndxWebAdministration.ps1 +++ b/source/Examples/Resources/Sample_EndToEndWebAdministration.ps1 @@ -1,46 +1,64 @@ <# .DESCRIPTION - This example shows how to use the xWebAdministration in an end to end scenario. + This example shows how to use the WebAdministrationDsc in an end to end scenario. #> -configuration Sample_EndToEndxWebAdministration +configuration Sample_EndToEndWebAdministration { param ( # Target nodes to apply the configuration [Parameter()] - [String[]] $NodeName = 'localhost', + [String[]] + $NodeName='localhost', + [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - [String] $WebAppPoolName, + [String] + $WebAppPoolName, + [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - [String] $WebSiteName, + [String] + $WebSiteName, + [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - [String] $PhysicalPathWebSite, + [String] + $PhysicalPathWebSite, + [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - [String] $WebApplicationName, + [String] + $WebApplicationName, + [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - [String] $PhysicalPathWebApplication, + [String] + $PhysicalPathWebApplication, + [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - [String] $WebVirtualDirectoryName, + [String] + $WebVirtualDirectoryName, + [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - [String] $PhysicalPathVirtualDir, + [String] + $PhysicalPathVirtualDir, + [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - [String] $Port + [String] + $Port + ) Import-DscResource -ModuleName PSDesiredStateConfiguration - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node $NodeName { # Create a Web Application Pool - xWebAppPool NewWebAppPool + WebAppPool NewWebAppPool { Name = $WebAppPoolName Ensure = "Present" @@ -72,11 +90,11 @@ configuration Sample_EndToEndxWebAdministration } #Create a New Website with Port - xWebSite NewWebSite + WebSite NewWebSite { Name = $WebSiteName Ensure = "Present" - BindingInfo = MSFT_xWebBindingInformation + BindingInfo = DSC_WebBindingInformation { Protocol = "http" Port = $Port @@ -84,29 +102,29 @@ configuration Sample_EndToEndxWebAdministration PhysicalPath = $PhysicalPathWebSite State = "Started" - DependsOn = @("[xWebAppPool]NewWebAppPool", "[File]NewWebsitePath") + DependsOn = @("[WebAppPool]NewWebAppPool", "[File]NewWebsitePath") } #Create a new Web Application - xWebApplication NewWebApplication + WebApplication NewWebApplication { Name = $WebApplicationName Website = $WebSiteName WebAppPool = $WebAppPoolName PhysicalPath = $PhysicalPathWebApplication Ensure = "Present" - DependsOn = @("[xWebSite]NewWebSite", "[File]NewWebApplicationPath") + DependsOn = @("[WebSite]NewWebSite", "[File]NewWebApplicationPath") } #Create a new virtual Directory - xWebVirtualDirectory NewVirtualDir + WebVirtualDirectory NewVirtualDir { Name = $WebVirtualDirectoryName Website = $WebSiteName WebApplication = $WebApplicationName PhysicalPath = $PhysicalPathVirtualDir Ensure = "Present" - DependsOn = @("[xWebApplication]NewWebApplication", "[File]NewVirtualDirectoryPath") + DependsOn = @("[WebApplication]NewWebApplication", "[File]NewVirtualDirectoryPath") } #Create an empty web.config file @@ -117,19 +135,7 @@ configuration Sample_EndToEndxWebAdministration " Ensure = "Present" - DependsOn = @("[xWebVirtualDirectory]NewVirtualDir") - } - - #Add an appSetting key1 - xWebConfigKeyValue ModifyWebConfig - { - Ensure = "Present" - ConfigSection = "AppSettings" - Key = "key1" - Value = "value1" - IsAttribute = $false - WebsitePath = "IIS:\sites\" + $WebsiteName - DependsOn = @("[File]CreateWebConfig") + DependsOn = @("[WebVirtualDirectory]NewVirtualDir") } #Add a webApplicationHandler diff --git a/source/Examples/Resources/xSslSettings/Sample_xSslSettings_RequireCert.ps1 b/source/Examples/Resources/SslSettings/Sample_SslSettings_RequireCert.ps1 similarity index 73% rename from source/Examples/Resources/xSslSettings/Sample_xSslSettings_RequireCert.ps1 rename to source/Examples/Resources/SslSettings/Sample_SslSettings_RequireCert.ps1 index be8da0acf..ca5c758d8 100644 --- a/source/Examples/Resources/xSslSettings/Sample_xSslSettings_RequireCert.ps1 +++ b/source/Examples/Resources/SslSettings/Sample_SslSettings_RequireCert.ps1 @@ -1,4 +1,4 @@ -configuration Sample_xSslSettings_RequireCert +configuration Sample_SslSettings_RequireCert { param ( @@ -7,11 +7,11 @@ configuration Sample_xSslSettings_RequireCert ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { - xSslSettings SiteDefaults + SslSettings SiteDefaults { Ensure = 'Present' Name = 'contoso.com' diff --git a/source/Examples/Resources/xWebAppPool/Sample_xWebAppPool.ps1 b/source/Examples/Resources/WebAppPool/Sample_WebAppPool.ps1 similarity index 93% rename from source/Examples/Resources/xWebAppPool/Sample_xWebAppPool.ps1 rename to source/Examples/Resources/WebAppPool/Sample_WebAppPool.ps1 index a08486950..0f2b10049 100644 --- a/source/Examples/Resources/xWebAppPool/Sample_xWebAppPool.ps1 +++ b/source/Examples/Resources/WebAppPool/Sample_WebAppPool.ps1 @@ -2,21 +2,21 @@ .SYNOPSIS Create and configure an application pool. .DESCRIPTION - This example shows how to use the xWebAppPool DSC resource to create and configure an application pool. + This example shows how to use the WebAppPool DSC resource to create and configure an application pool. #> -Configuration Sample_xWebAppPool +Configuration Sample_WebAppPool { param ( [String[]]$NodeName = 'localhost' ) - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $NodeName { - xWebAppPool SampleAppPool + WebAppPool SampleAppPool { Name = 'SampleAppPool' Ensure = 'Present' diff --git a/source/Examples/Resources/xWebAppPoolDefaults/Sample_xWebAppPoolDefaults.ps1 b/source/Examples/Resources/WebAppPoolDefaults/Sample_WebAppPoolDefaults.ps1 similarity index 70% rename from source/Examples/Resources/xWebAppPoolDefaults/Sample_xWebAppPoolDefaults.ps1 rename to source/Examples/Resources/WebAppPoolDefaults/Sample_WebAppPoolDefaults.ps1 index a2bc19fd1..7d2b40227 100644 --- a/source/Examples/Resources/xWebAppPoolDefaults/Sample_xWebAppPoolDefaults.ps1 +++ b/source/Examples/Resources/WebAppPoolDefaults/Sample_WebAppPoolDefaults.ps1 @@ -2,10 +2,10 @@ .SYNOPSIS An example of configuring the application pool default settings. .DESCRIPTION - This examples show how to use xWebAppPoolDefaults for configuring the application pool default settings. + This examples show how to use WebAppPoolDefaults for configuring the application pool default settings. The resource is currently limited to configuring the managed runtime version and the identity used for the application pools. #> -Configuration Sample_xWebAppPoolDefaults +Configuration Sample_WebAppPoolDefaults { param ( @@ -14,12 +14,12 @@ Configuration Sample_xWebAppPoolDefaults ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration + Import-DscResource -Module WebAdministrationDsc, PSDesiredStateConfiguration Node $NodeName { # Configures the application pool defaults. - xWebAppPoolDefaults PoolDefaults + WebAppPoolDefaults PoolDefaults { IsSingleInstance = 'Yes' ManagedRuntimeVersion = 'v4.0' diff --git a/source/Examples/Resources/xWebApplication/Sample_xWebApplication.ps1 b/source/Examples/Resources/WebApplication/Sample_WebApplication.ps1 similarity index 79% rename from source/Examples/Resources/xWebApplication/Sample_xWebApplication.ps1 rename to source/Examples/Resources/WebApplication/Sample_WebApplication.ps1 index 32d7f2403..299394f55 100644 --- a/source/Examples/Resources/xWebApplication/Sample_xWebApplication.ps1 +++ b/source/Examples/Resources/WebApplication/Sample_WebApplication.ps1 @@ -1,7 +1,7 @@ <# - This shows an example for all possible settings for the xWebApplication resource + This shows an example for all possible settings for the WebApplication resource #> -configuration Sample_xWebApplication +configuration Sample_WebApplication { param @@ -14,11 +14,11 @@ configuration Sample_xWebApplication [String] $PhysicalPath ) - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node $NodeName { - xWebApplication WebApplication + WebApplication WebApplication { Website = 'Website' Ensure = 'Present' @@ -27,7 +27,7 @@ configuration Sample_xWebApplication WebAppPool = 'DefaultAppPool' ApplicationType = 'ApplicationType' AuthenticationInfo = ` - MSFT_xWebApplicationAuthenticationInformation + DSC_WebApplicationAuthenticationInformation { Anonymous = $true Basic = $false diff --git a/source/Examples/Resources/xWebApplication/Sample_xWebApplication_NewWebApplication.ps1 b/source/Examples/Resources/WebApplication/Sample_WebApplication_NewWebApplication.ps1 similarity index 83% rename from source/Examples/Resources/xWebApplication/Sample_xWebApplication_NewWebApplication.ps1 rename to source/Examples/Resources/WebApplication/Sample_WebApplication_NewWebApplication.ps1 index 98e866175..61840344e 100644 --- a/source/Examples/Resources/xWebApplication/Sample_xWebApplication_NewWebApplication.ps1 +++ b/source/Examples/Resources/WebApplication/Sample_WebApplication_NewWebApplication.ps1 @@ -2,9 +2,9 @@ .SYNOPSIS Create a new web application on the Default Web Site .DESCRIPTION - This example shows how to use the xWebApplication DSC resource to create a new web application. + This example shows how to use the WebApplication DSC resource to create a new web application. #> -Configuration Sample_xWebApplication_NewWebApplication +Configuration Sample_WebApplication_NewWebApplication { param ( @@ -19,7 +19,7 @@ Configuration Sample_xWebApplication_NewWebApplication # Import the module that defines custom resources Import-DscResource -Module PSDesiredStateConfiguration - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { @@ -38,7 +38,7 @@ Configuration Sample_xWebApplication_NewWebApplication } # Start the Default Web Site - xWebSite DefaultSite + WebSite DefaultSite { Ensure = 'Present' Name = 'Default Web Site' @@ -48,7 +48,7 @@ Configuration Sample_xWebApplication_NewWebApplication } # Create a new application pool for the application - xWebAppPool SampleAppPool + WebAppPool SampleAppPool { Ensure = 'Present' Name = 'SampleAppPool' @@ -66,7 +66,7 @@ Configuration Sample_xWebApplication_NewWebApplication } # Create a new web application with Windows Authentication - xWebApplication SampleApplication + WebApplication SampleApplication { Ensure = 'Present' Name = 'SampleApplication' @@ -74,7 +74,7 @@ Configuration Sample_xWebApplication_NewWebApplication Website = 'Default Web Site' PreloadEnabled = $true ServiceAutoStartEnabled = $true - AuthenticationInfo = MSFT_xWebApplicationAuthenticationInformation + AuthenticationInfo = DSC_WebApplicationAuthenticationInformation { Anonymous = $false Basic = $false @@ -83,7 +83,7 @@ Configuration Sample_xWebApplication_NewWebApplication } SslFlags = '' PhysicalPath = $DestinationPath - DependsOn = '[xWebSite]DefaultSite','[xWebAppPool]SampleAppPool' + DependsOn = '[WebSite]DefaultSite','[WebAppPool]SampleAppPool' } } } diff --git a/source/Examples/Resources/WebApplicationHandler/Sample_WebApplicationHandler.ps1 b/source/Examples/Resources/WebApplicationHandler/Sample_WebApplicationHandler.ps1 index 31b385f0e..89759dd1a 100644 --- a/source/Examples/Resources/WebApplicationHandler/Sample_WebApplicationHandler.ps1 +++ b/source/Examples/Resources/WebApplicationHandler/Sample_WebApplicationHandler.ps1 @@ -1,6 +1,6 @@ Configuration Example { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node 'localhost' { diff --git a/source/Examples/Resources/xWebConfigProperty/Sample_xWebConfigProperty_Add.ps1 b/source/Examples/Resources/WebConfigProperty/Sample_WebConfigProperty_Add.ps1 similarity index 70% rename from source/Examples/Resources/xWebConfigProperty/Sample_xWebConfigProperty_Add.ps1 rename to source/Examples/Resources/WebConfigProperty/Sample_WebConfigProperty_Add.ps1 index afae50c03..a81cf8568 100644 --- a/source/Examples/Resources/xWebConfigProperty/Sample_xWebConfigProperty_Add.ps1 +++ b/source/Examples/Resources/WebConfigProperty/Sample_WebConfigProperty_Add.ps1 @@ -3,10 +3,10 @@ Disables directory browsing in the default website. .DESCRIPTION - This example shows how to use the xWebConfigProperty DSC resource for setting a configuration property. + This example shows how to use the WebConfigProperty DSC resource for setting a configuration property. It will set the value of the system.webServer/directoryBrowse enabled attribute to false in the Web.config file for the default website. #> -Configuration Sample_xWebConfigProperty_Add +Configuration Sample_WebConfigProperty_Add { param ( @@ -17,11 +17,11 @@ Configuration Sample_xWebConfigProperty_Add ) # Import the modules that define custom resources - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $NodeName { - xWebConfigProperty "$($NodeName) - Ensure 'directory browsing' is set to disabled - Add" + WebConfigProperty "$($NodeName) - Ensure 'directory browsing' is set to disabled - Add" { WebsitePath = 'IIS:\Sites\Default Web Site' Filter = 'system.webServer/directoryBrowse' diff --git a/source/Examples/Resources/xWebConfigProperty/Sample_xWebConfigProperty_Remove.ps1 b/source/Examples/Resources/WebConfigProperty/Sample_WebConfigProperty_Remove.ps1 similarity index 68% rename from source/Examples/Resources/xWebConfigProperty/Sample_xWebConfigProperty_Remove.ps1 rename to source/Examples/Resources/WebConfigProperty/Sample_WebConfigProperty_Remove.ps1 index 323c121ad..b2902d779 100644 --- a/source/Examples/Resources/xWebConfigProperty/Sample_xWebConfigProperty_Remove.ps1 +++ b/source/Examples/Resources/WebConfigProperty/Sample_WebConfigProperty_Remove.ps1 @@ -3,10 +3,10 @@ Removes configuration of directory browsing in the default website. .DESCRIPTION - This example shows how to use the xWebConfigProperty DSC resource for removing a configuration property. + This example shows how to use the WebConfigProperty DSC resource for removing a configuration property. It will remove the system.webServer/directoryBrowse enabled attribute (if present) in the Web.config file for the default website. #> -Configuration Sample_xWebConfigProperty_Remove +Configuration Sample_WebConfigProperty_Remove { param ( @@ -17,11 +17,11 @@ Configuration Sample_xWebConfigProperty_Remove ) # Import the modules that define custom resources - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $NodeName { - xWebConfigProperty "$($NodeName) - Ensure 'directory browsing' is set to disabled - Remove" + WebConfigProperty "$($NodeName) - Ensure 'directory browsing' is set to disabled - Remove" { WebsitePath = 'IIS:\Sites\Default Web Site' Filter = 'system.webServer/directoryBrowse' diff --git a/source/Examples/Resources/xWebConfigPropertyCollection/Sample_xWebConfigPropertyCollection_Add.ps1 b/source/Examples/Resources/WebConfigPropertyCollection/Sample_WebConfigPropertyCollection_Add.ps1 similarity index 74% rename from source/Examples/Resources/xWebConfigPropertyCollection/Sample_xWebConfigPropertyCollection_Add.ps1 rename to source/Examples/Resources/WebConfigPropertyCollection/Sample_WebConfigPropertyCollection_Add.ps1 index ac64e81a6..2927cd218 100644 --- a/source/Examples/Resources/xWebConfigPropertyCollection/Sample_xWebConfigPropertyCollection_Add.ps1 +++ b/source/Examples/Resources/WebConfigPropertyCollection/Sample_WebConfigPropertyCollection_Add.ps1 @@ -3,10 +3,10 @@ Disables the HTTP TRACE method at the server level. .DESCRIPTION - This example shows how to use the xWebConfigPropertyCollection DSC resource for adding a configuration element. + This example shows how to use the WebConfigPropertyCollection DSC resource for adding a configuration element. It will add an "add" element to the system.webServer/security/requestFiltering/verbs collection to disable the HTTP TRACE verb. #> -Configuration Sample_xWebConfigPropertyCollection_Add +Configuration Sample_WebConfigPropertyCollection_Add { param ( @@ -17,11 +17,11 @@ Configuration Sample_xWebConfigPropertyCollection_Add ) # Import the modules that define custom resources - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $NodeName { - xWebConfigPropertyCollection "$($NodeName) - Disable HTTP TRACE method" + WebConfigPropertyCollection "$($NodeName) - Disable HTTP TRACE method" { WebsitePath = 'MACHINE/WEBROOT/APPHOST' Filter = 'system.webServer/security/requestFiltering' diff --git a/source/Examples/Resources/xWebConfigPropertyCollection/Sample_xWebConfigPropertyCollection_Remove.ps1 b/source/Examples/Resources/WebConfigPropertyCollection/Sample_WebConfigPropertyCollection_Remove.ps1 similarity index 74% rename from source/Examples/Resources/xWebConfigPropertyCollection/Sample_xWebConfigPropertyCollection_Remove.ps1 rename to source/Examples/Resources/WebConfigPropertyCollection/Sample_WebConfigPropertyCollection_Remove.ps1 index c0d5ee578..25d513d20 100644 --- a/source/Examples/Resources/xWebConfigPropertyCollection/Sample_xWebConfigPropertyCollection_Remove.ps1 +++ b/source/Examples/Resources/WebConfigPropertyCollection/Sample_WebConfigPropertyCollection_Remove.ps1 @@ -3,10 +3,10 @@ Removes disabling the HTTP TRACE method at the server level. .DESCRIPTION - This example shows how to use the xWebConfigPropertyCollection DSC resource for removing a configuration element. + This example shows how to use the WebConfigPropertyCollection DSC resource for removing a configuration element. It will remove the "add" element from the system.webServer/security/requestFiltering/verbs collection (if present) for disabling the HTTP TRACE verb. #> -Configuration Sample_xWebConfigPropertyCollection_Remove +Configuration Sample_WebConfigPropertyCollection_Remove { param ( @@ -17,11 +17,11 @@ Configuration Sample_xWebConfigPropertyCollection_Remove ) # Import the modules that define custom resources - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $NodeName { - xWebConfigPropertyCollection "$($NodeName) - Remove disabling HTTP TRACE method" + WebConfigPropertyCollection "$($NodeName) - Remove disabling HTTP TRACE method" { WebsitePath = 'MACHINE/WEBROOT/APPHOST' Filter = 'system.webServer/security/requestFiltering' diff --git a/source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite.ps1 b/source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite.ps1 similarity index 92% rename from source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite.ps1 rename to source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite.ps1 index 8827747ea..dc80859f6 100644 --- a/source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite.ps1 +++ b/source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite.ps1 @@ -1,4 +1,4 @@ -configuration Sample_xWebSite_NewWebsite +configuration Sample_WebSite_NewWebsite { param ( @@ -31,7 +31,7 @@ configuration Sample_xWebSite_NewWebsite ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration + Import-DscResource -Module WebAdministrationDsc, PSDesiredStateConfiguration Node $NodeName { @@ -50,7 +50,7 @@ configuration Sample_xWebSite_NewWebsite } # Stop the default website - xWebSite DefaultSite + WebSite DefaultSite { Ensure = 'Present' Name = 'Default Web Site' @@ -72,7 +72,7 @@ configuration Sample_xWebSite_NewWebsite } # Create the new Website - xWebSite NewWebsite + WebSite NewWebsite { Ensure = 'Present' Name = $WebSiteName diff --git a/source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsiteFromConfigurationData.ps1 b/source/Examples/Resources/WebSite/Sample_WebSite_NewWebsiteFromConfigurationData.ps1 similarity index 88% rename from source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsiteFromConfigurationData.ps1 rename to source/Examples/Resources/WebSite/Sample_WebSite_NewWebsiteFromConfigurationData.ps1 index 3f22fe08d..d5b80920b 100644 --- a/source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsiteFromConfigurationData.ps1 +++ b/source/Examples/Resources/WebSite/Sample_WebSite_NewWebsiteFromConfigurationData.ps1 @@ -1,7 +1,7 @@ -Configuration Sample_xWebSite_NewWebsiteFromConfigurationData +Configuration Sample_WebSite_NewWebsiteFromConfigurationData { # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration + Import-DscResource -Module WebAdministrationDsc, PSDesiredStateConfiguration # Dynamically find the applicable nodes from configuration data Node $AllNodes.where{ $_.Role -eq 'Web' }.NodeName @@ -20,8 +20,8 @@ Configuration Sample_xWebSite_NewWebsiteFromConfigurationData Name = 'Web-Asp-Net45' } - # Stop an existing website (set up in Sample_xWebSite_Default) - xWebSite DefaultSite + # Stop an existing website (set up in Sample_WebSite_Default) + WebSite DefaultSite { Ensure = 'Present' Name = 'Default Web Site' @@ -43,7 +43,7 @@ Configuration Sample_xWebSite_NewWebsiteFromConfigurationData } # Create a new website - xWebSite BakeryWebSite + WebSite BakeryWebSite { Ensure = 'Present' Name = $Node.WebsiteName diff --git a/source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite_UsingCertificateSubject.ps1 b/source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite_UsingCertificateSubject.ps1 similarity index 91% rename from source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite_UsingCertificateSubject.ps1 rename to source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite_UsingCertificateSubject.ps1 index c45d251cd..edb4866b4 100644 --- a/source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite_UsingCertificateSubject.ps1 +++ b/source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite_UsingCertificateSubject.ps1 @@ -3,7 +3,7 @@ When specifying a HTTPS web binding you can also specify a certifcate subject, for cases where the certificate is being generated by the same configuration using something like xCertReq. #> -Configuration Sample_xWebSite_NewWebsite_UsingCertificateSubject +Configuration Sample_WebSite_NewWebsite_UsingCertificateSubject { param ( @@ -28,7 +28,7 @@ Configuration Sample_xWebSite_NewWebsite_UsingCertificateSubject ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { # Install the IIS role @@ -46,7 +46,7 @@ Configuration Sample_xWebSite_NewWebsite_UsingCertificateSubject } # Stop the default website - xWebSite DefaultSite + WebSite DefaultSite { Ensure = 'Present' Name = 'Default Web Site' @@ -67,14 +67,14 @@ Configuration Sample_xWebSite_NewWebsite_UsingCertificateSubject } # Create the new Website with HTTPS - xWebSite NewWebsite + WebSite NewWebsite { Ensure = 'Present' Name = $WebSiteName State = 'Started' PhysicalPath = $DestinationPath BindingInfo = @( - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = 'HTTPS' Port = 8444 diff --git a/source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite_UsingCertificateThumbprint.ps1 b/source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite_UsingCertificateThumbprint.ps1 similarity index 90% rename from source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite_UsingCertificateThumbprint.ps1 rename to source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite_UsingCertificateThumbprint.ps1 index 0f76f1528..bda9f579f 100644 --- a/source/Examples/Resources/xWebSite/Sample_xWebSite_NewWebsite_UsingCertificateThumbprint.ps1 +++ b/source/Examples/Resources/WebSite/Sample_WebSite_NewWebsite_UsingCertificateThumbprint.ps1 @@ -2,10 +2,10 @@ .DESCRIPTION While setting up IIS and stopping the default website is interesting, it isn�t quite useful yet. After all, people typically use IIS to set up websites of their own with custom protocol and bindings. - Fortunately, using DSC, adding another website is as simple as using the File and xWebSite resources to + Fortunately, using DSC, adding another website is as simple as using the File and WebSite resources to copy the website content and configure the website. #> -Configuration Sample_xWebSite_NewWebsite_UsingCertificateThumbprint +Configuration Sample_WebSite_NewWebsite_UsingCertificateThumbprint { param ( @@ -30,7 +30,7 @@ Configuration Sample_xWebSite_NewWebsite_UsingCertificateThumbprint ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { # Install the IIS role @@ -48,7 +48,7 @@ Configuration Sample_xWebSite_NewWebsite_UsingCertificateThumbprint } # Stop the default website - xWebSite DefaultSite + WebSite DefaultSite { Ensure = 'Present' Name = 'Default Web Site' @@ -69,21 +69,21 @@ Configuration Sample_xWebSite_NewWebsite_UsingCertificateThumbprint } # Create the new Website with HTTPS - xWebSite NewWebsite + WebSite NewWebsite { Ensure = 'Present' Name = $WebSiteName State = 'Started' PhysicalPath = $DestinationPath BindingInfo = @( - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = 'HTTPS' Port = 8443 CertificateThumbprint = '71AD93562316F21F74606F1096B85D66289ED60F' CertificateStoreName = 'WebHosting' } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = 'HTTPS' Port = 8444 diff --git a/source/Examples/Resources/xWebSite/Sample_xWebSite_RemoveDefault.ps1 b/source/Examples/Resources/WebSite/Sample_WebSite_RemoveDefault.ps1 similarity index 81% rename from source/Examples/Resources/xWebSite/Sample_xWebSite_RemoveDefault.ps1 rename to source/Examples/Resources/WebSite/Sample_WebSite_RemoveDefault.ps1 index 494312bf8..181bc19f9 100644 --- a/source/Examples/Resources/xWebSite/Sample_xWebSite_RemoveDefault.ps1 +++ b/source/Examples/Resources/WebSite/Sample_WebSite_RemoveDefault.ps1 @@ -1,4 +1,4 @@ -configuration Sample_xWebSite_RemoveDefault +configuration Sample_WebSite_RemoveDefault { param ( @@ -7,7 +7,7 @@ configuration Sample_xWebSite_RemoveDefault ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration + Import-DscResource -Module WebAdministrationDsc, PSDesiredStateConfiguration Node $NodeName { @@ -19,7 +19,7 @@ configuration Sample_xWebSite_RemoveDefault } # Stop the default website - xWebSite DefaultSite + WebSite DefaultSite { Ensure = 'Present' Name = 'Default Web Site' diff --git a/source/Examples/Resources/xWebSite/Sample_xWebSite_StopDefault.ps1 b/source/Examples/Resources/WebSite/Sample_WebSite_StopDefault.ps1 similarity index 88% rename from source/Examples/Resources/xWebSite/Sample_xWebSite_StopDefault.ps1 rename to source/Examples/Resources/WebSite/Sample_WebSite_StopDefault.ps1 index 27234fa0c..3a872b9a1 100644 --- a/source/Examples/Resources/xWebSite/Sample_xWebSite_StopDefault.ps1 +++ b/source/Examples/Resources/WebSite/Sample_WebSite_StopDefault.ps1 @@ -4,7 +4,7 @@ This example sets up your IIS web server by installing IIS Windows Feature. After that, it will stop the default website by setting `State = Stopped`. #> -Configuration Sample_xWebSite_StopDefault +Configuration Sample_WebSite_StopDefault { param ( @@ -12,7 +12,7 @@ Configuration Sample_xWebSite_StopDefault [string[]]$NodeName = 'localhost' ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { # Install the IIS role @@ -22,7 +22,7 @@ Configuration Sample_xWebSite_StopDefault Name = "Web-Server" } # Stop the default website - xWebSite DefaultSite + WebSite DefaultSite { Ensure = "Present" Name = "Default Web Site" diff --git a/source/Examples/Resources/xWebSite/Sample_xWebSite_WithSSLFlags.ps1 b/source/Examples/Resources/WebSite/Sample_WebSite_WithSSLFlags.ps1 similarity index 91% rename from source/Examples/Resources/xWebSite/Sample_xWebSite_WithSSLFlags.ps1 rename to source/Examples/Resources/WebSite/Sample_WebSite_WithSSLFlags.ps1 index 19a525eae..bfe5b5d32 100644 --- a/source/Examples/Resources/xWebSite/Sample_xWebSite_WithSSLFlags.ps1 +++ b/source/Examples/Resources/WebSite/Sample_WebSite_WithSSLFlags.ps1 @@ -1,4 +1,4 @@ -configuration Sample_xWebSite_WithSSLFlags +configuration Sample_WebSite_WithSSLFlags { param ( @@ -22,7 +22,7 @@ configuration Sample_xWebSite_WithSSLFlags ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration + Import-DscResource -Module WebAdministrationDsc, PSDesiredStateConfiguration Node $NodeName { @@ -41,7 +41,7 @@ configuration Sample_xWebSite_WithSSLFlags } # Stop the default website - xWebSite DefaultSite + WebSite DefaultSite { Ensure = "Present" Name = "Default Web Site" @@ -65,14 +65,14 @@ configuration Sample_xWebSite_WithSSLFlags # Create the new Website # Have it set to the CertificateThumbprint # and set that the Server Name Indication is required - xWebSite NewWebsite + WebSite NewWebsite { Ensure = "Present" Name = $WebSiteName State = "Started" PhysicalPath = $DestinationPath DependsOn = "[File]WebContent" - BindingInfo = MSFT_xWebBindingInformation + BindingInfo = DSC_WebBindingInformation { Protocol = 'https' Port = '443' diff --git a/source/Examples/Resources/xWebSiteDefaults/Sample_xWebSiteDefaults.ps1 b/source/Examples/Resources/WebSiteDefaults/Sample_WebSiteDefaults.ps1 similarity index 74% rename from source/Examples/Resources/xWebSiteDefaults/Sample_xWebSiteDefaults.ps1 rename to source/Examples/Resources/WebSiteDefaults/Sample_WebSiteDefaults.ps1 index dd4d1cee6..baed8b572 100644 --- a/source/Examples/Resources/xWebSiteDefaults/Sample_xWebSiteDefaults.ps1 +++ b/source/Examples/Resources/WebSiteDefaults/Sample_WebSiteDefaults.ps1 @@ -2,9 +2,9 @@ .SYNOPSIS An example of configuring the website default settings. .DESCRIPTION - This examples show how to use xWebSiteDefaults for configuring the website default settings. + This examples show how to use WebSiteDefaults for configuring the website default settings. #> -Configuration Sample_xWebSiteDefaults +Configuration Sample_WebSiteDefaults { param ( @@ -13,11 +13,11 @@ Configuration Sample_xWebSiteDefaults ) # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { - xWebSiteDefaults SiteDefaults + WebSiteDefaults SiteDefaults { IsSingleInstance = 'Yes' LogFormat = 'IIS' diff --git a/source/Examples/Resources/xWebVirtualDirectory/Sample_xWebVirtualDirectory_NewVirtualDirectory.ps1 b/source/Examples/Resources/WebVirtualDirectory/Sample_WebVirtualDirectory_NewVirtualDirectory.ps1 similarity index 86% rename from source/Examples/Resources/xWebVirtualDirectory/Sample_xWebVirtualDirectory_NewVirtualDirectory.ps1 rename to source/Examples/Resources/WebVirtualDirectory/Sample_WebVirtualDirectory_NewVirtualDirectory.ps1 index b131352c4..aede44bee 100644 --- a/source/Examples/Resources/xWebVirtualDirectory/Sample_xWebVirtualDirectory_NewVirtualDirectory.ps1 +++ b/source/Examples/Resources/WebVirtualDirectory/Sample_WebVirtualDirectory_NewVirtualDirectory.ps1 @@ -2,10 +2,10 @@ .SYNOPSIS Create a new web virtual directory on the Default Web Site .DESCRIPTION - This example shows how to use the xWebVirtualDirectory DSC resource to create a new virtual + This example shows how to use the WebVirtualDirectory DSC resource to create a new virtual directory on the Default Web Site. #> -configuration Sample_xWebVirtualDirectory_NewVirtualDirectory +configuration Sample_WebVirtualDirectory_NewVirtualDirectory { param ( @@ -28,7 +28,7 @@ configuration Sample_xWebVirtualDirectory_NewVirtualDirectory # Import the module that defines custom resources Import-DscResource -Module PSDesiredStateConfiguration - Import-DscResource -Module xWebAdministration + Import-DscResource -Module WebAdministrationDsc Node $NodeName { @@ -40,7 +40,7 @@ configuration Sample_xWebVirtualDirectory_NewVirtualDirectory } # Start the default website - xWebSite DefaultSite + WebSite DefaultSite { Ensure = 'Present' Name = 'Default Web Site' @@ -59,7 +59,7 @@ configuration Sample_xWebVirtualDirectory_NewVirtualDirectory } # Create the new virtual directory - xWebVirtualDirectory NewVirtualDirectory + WebVirtualDirectory NewVirtualDirectory { Ensure = 'Present' Website = "Default Web Site" diff --git a/source/Examples/Resources/xIisHandler/Sample_xIisHandler_Remove32Bit.ps1 b/source/Examples/Resources/xIisHandler/Sample_xIisHandler_Remove32Bit.ps1 deleted file mode 100644 index 9e56c877a..000000000 --- a/source/Examples/Resources/xIisHandler/Sample_xIisHandler_Remove32Bit.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -configuration Sample_xIisHandler_Remove32Bit -{ - param - ( - # Target nodes to apply the configuration - [string[]]$NodeName = 'localhost' - ) - - # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration - - Node $NodeName - { - # Install the IIS role - WindowsFeature IIS - { - Ensure = 'Present' - Name = 'Web-Server' - } - - xIisHandler aspq_ISAPI_4_0_32bit - { - Name = 'aspq-ISAPI-4.0_32bit' - Ensure = 'Absent' - } - - xIisHandler cshtm_ISAPI_4_0_32bit - { - Name = 'cshtm-ISAPI-4.0_32bit' - Ensure = 'Absent' - } - - xIisHandler cshtml_ISAPI_4_0_32bit - { - Name = 'cshtml-ISAPI-4.0_32bit' - Ensure = 'Absent' - } - - xIisHandler vbhtm_ISAPI_4_0_32bit - { - Name = 'vbhtm-ISAPI-4.0_32bit' - Ensure = 'Absent' - } - - xIisHandler vbhtml_ISAPI_4_0_32bit - { - Name = 'vbhtml-ISAPI-4.0_32bit' - Ensure = 'Absent' - } - - } -} diff --git a/source/Examples/Resources/xIisServerDefaults/Sample_xIisServerDefaults.ps1 b/source/Examples/Resources/xIisServerDefaults/Sample_xIisServerDefaults.ps1 deleted file mode 100644 index 54ac1e43d..000000000 --- a/source/Examples/Resources/xIisServerDefaults/Sample_xIisServerDefaults.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -configuration Sample_xIISServerDefaults -{ - param - ( - # Target nodes to apply the configuration - [string[]]$NodeName = 'localhost' - ) - - # Import the module that defines custom resources - Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration - - Node $NodeName - { - xWebSiteDefaults SiteDefaults - { - IsSingleInstance = 'Yes' - LogFormat = 'IIS' - AllowSubDirConfig = 'true' - } - - - xWebAppPoolDefaults PoolDefaults - { - IsSingleInstance = 'Yes' - ManagedRuntimeVersion = 'v4.0' - IdentityType = 'ApplicationPoolIdentity' - } - } -} diff --git a/source/Examples/Resources/xWebConfigKeyValue/Sample_xWebConfigKeyValue_AddAppSetting.ps1 b/source/Examples/Resources/xWebConfigKeyValue/Sample_xWebConfigKeyValue_AddAppSetting.ps1 deleted file mode 100644 index d3525eb36..000000000 --- a/source/Examples/Resources/xWebConfigKeyValue/Sample_xWebConfigKeyValue_AddAppSetting.ps1 +++ /dev/null @@ -1,34 +0,0 @@ -<# - .SYNOPSIS - Adds an app setting WebsiteTitle to the configuration file of the website. - .DESCRIPTION - This example shows how to use the xWebConfigKeyValue DSC resource for adding an extra key and value to appSettings. - It will add a key WebSiteTitle with value to the configuration of the site specified. -#> -Configuration Sample_xWebConfigKeyValue_AddAppSetting -{ - param - ( - # Target nodes to apply the configuration. - [String[]] $NodeName = 'localhost', - - # Target website to which the key should be added. - [String] $WebsiteName = 'Default Web Site' - ) - - # Import the modules that define custom resources - Import-DscResource -Module xWebAdministration - - Node $NodeName - { - # Adds an extra app setting to the AppSettings section. - xWebConfigKeyValue DefaultSite - { - Ensure = 'Present' - ConfigSection = 'AppSettings' - Key = 'WebsiteTitle' - Value = 'xWebAdministration DSC Examples' - WebsitePath = 'IIS:\Sites\' + $WebsiteName - } - } -} diff --git a/source/Examples/Resources/xWebConfigKeyValue/Sample_xWebConfigKeyValue_RemoveAppSetting.ps1 b/source/Examples/Resources/xWebConfigKeyValue/Sample_xWebConfigKeyValue_RemoveAppSetting.ps1 deleted file mode 100644 index 00f7ad4e4..000000000 --- a/source/Examples/Resources/xWebConfigKeyValue/Sample_xWebConfigKeyValue_RemoveAppSetting.ps1 +++ /dev/null @@ -1,34 +0,0 @@ -<# - .SYNOPSIS - Removes an app setting WebsiteTitle from the configuration file of the website if present. - .DESCRIPTION - This example shows how to use the xWebConfigKeyValue DSC resource for ensuring a key is not pressent in appSettings. - It will remove a setting with key WebSiteTitle from the configuration of the site specified. -#> -Configuration Sample_xWebConfigKeyValue_RemoveAppSetting -{ - param - ( - # Target nodes to apply the configuration. - [String[]] $NodeName = 'localhost', - - # Target website from which the key should be removed. - [String] $WebsiteName = 'Default Web Site' - ) - - # Import the modules that define custom resources - Import-DscResource -Module xWebAdministration - - Node $NodeName - { - # Removes an extra app setting from the AppSettings section. - xWebConfigKeyValue DefaultSite - { - Ensure = 'Absent' - ConfigSection = 'AppSettings' - Key = 'WebsiteTitle' - Value = 'xWebAdministration DSC Examples' - WebsitePath = 'IIS:\Sites\' + $WebsiteName - } - } -} diff --git a/source/Modules/xWebAdministration.Common/xWebAdministration.Common.psd1 b/source/Modules/WebAdministrationDsc.Common/WebAdministrationDsc.Common.psd1 similarity index 85% rename from source/Modules/xWebAdministration.Common/xWebAdministration.Common.psd1 rename to source/Modules/WebAdministrationDsc.Common/WebAdministrationDsc.Common.psd1 index 6c24f4915..def781d1a 100644 --- a/source/Modules/xWebAdministration.Common/xWebAdministration.Common.psd1 +++ b/source/Modules/WebAdministrationDsc.Common/WebAdministrationDsc.Common.psd1 @@ -1,6 +1,6 @@ @{ # Script module or binary module file associated with this manifest. - RootModule = 'xWebAdministration.Common.psm1' + RootModule = 'WebAdministrationDsc.Common.psm1' # Version number of this module. ModuleVersion = '1.0.0' @@ -18,18 +18,11 @@ Copyright = 'Copyright the DSC Community contributors. All rights reserved.' # Description of the functionality provided by this module - Description = 'Functions used by the DSC resources in SqlServerDsc.' + Description = 'Functions used by the DSC resources in WebAdministrationDsc.' # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @( - 'New-InvalidArgumentException', - 'New-InvalidOperationException', - 'New-ObjectNotFoundException', - 'New-InvalidResultException', - 'Get-LocalizedData' 'Start-ProcessWithTimeout' - 'Assert-Module' - 'Compare-ResourcePropertyState' 'Test-DscPropertyState' 'New-CimCredentialInstance' 'Get-CurrentUser' @@ -57,4 +50,3 @@ } # End of PrivateData hashtable } - diff --git a/source/Modules/xWebAdministration.Common/xWebAdministration.Common.psm1 b/source/Modules/WebAdministrationDsc.Common/WebAdministrationDsc.Common.psm1 similarity index 50% rename from source/Modules/xWebAdministration.Common/xWebAdministration.Common.psm1 rename to source/Modules/WebAdministrationDsc.Common/WebAdministrationDsc.Common.psm1 index 4aaca568a..a0239ffdf 100644 --- a/source/Modules/xWebAdministration.Common/xWebAdministration.Common.psm1 +++ b/source/Modules/WebAdministrationDsc.Common/WebAdministrationDsc.Common.psm1 @@ -1,261 +1,8 @@ -<# - .SYNOPSIS - Retrieves the localized string data based on the machine's culture. - Falls back to en-US strings if the machine's culture is not supported. - - .PARAMETER ResourceName - The name of the resource as it appears before '.strings.psd1' of the localized string file. - For example: - For WindowsOptionalFeature: MSFT_WindowsOptionalFeature - For Service: MSFT_ServiceResource - For Registry: MSFT_RegistryResource - For Helper: SqlServerDscHelper - - .PARAMETER ScriptRoot - Optional. The root path where to expect to find the culture folder. This is only needed - for localization in helper modules. This should not normally be used for resources. - - .NOTES - To be able to use localization in the helper function, this function must - be first in the file, before Get-LocalizedData is used by itself to load - localized data for this helper module (see directly after this function). -#> -function Get-LocalizedData -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $ResourceName, - - [Parameter()] - [ValidateNotNullOrEmpty()] - [System.String] - $ScriptRoot - ) - - if (-not $ScriptRoot) - { - $dscResourcesFolder = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'DSCResources' - $resourceDirectory = Join-Path -Path $dscResourcesFolder -ChildPath $ResourceName - } - else - { - $resourceDirectory = $ScriptRoot - } - - $localizedStringFileLocation = Join-Path -Path $resourceDirectory -ChildPath $PSUICulture - - if (-not (Test-Path -Path $localizedStringFileLocation)) - { - # Fallback to en-US - $localizedStringFileLocation = Join-Path -Path $resourceDirectory -ChildPath 'en-US' - } - - Import-LocalizedData ` - -BindingVariable 'localizedData' ` - -FileName "$ResourceName.strings.psd1" ` - -BaseDirectory $localizedStringFileLocation - - return $localizedData -} - -<# - .SYNOPSIS - Creates and throws an invalid argument exception. - - .PARAMETER Message - The message explaining why this error is being thrown. - - .PARAMETER ArgumentName - The name of the invalid argument that is causing this error to be thrown. -#> -function New-InvalidArgumentException -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Message, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $ArgumentName - ) - - $argumentException = New-Object -TypeName 'ArgumentException' ` - -ArgumentList @($Message, $ArgumentName) - - $newObjectParameters = @{ - TypeName = 'System.Management.Automation.ErrorRecord' - ArgumentList = @($argumentException, $ArgumentName, 'InvalidArgument', $null) - } - - $errorRecord = New-Object @newObjectParameters - - throw $errorRecord -} - -<# - .SYNOPSIS - Creates and throws an invalid operation exception. - - .PARAMETER Message - The message explaining why this error is being thrown. - - .PARAMETER ErrorRecord - The error record containing the exception that is causing this terminating error. -#> -function New-InvalidOperationException -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Message, - - [Parameter()] - [ValidateNotNull()] - [System.Management.Automation.ErrorRecord] - $ErrorRecord - ) - - if ($null -eq $ErrorRecord) - { - $invalidOperationException = New-Object -TypeName 'InvalidOperationException' ` - -ArgumentList @($Message) - } - else - { - $invalidOperationException = New-Object -TypeName 'InvalidOperationException' ` - -ArgumentList @($Message, $ErrorRecord.Exception) - } - - $newObjectParameters = @{ - TypeName = 'System.Management.Automation.ErrorRecord' - ArgumentList = @( - $invalidOperationException.ToString(), - 'MachineStateIncorrect', - 'InvalidOperation', - $null - ) - } - - $errorRecordToThrow = New-Object @newObjectParameters - - throw $errorRecordToThrow -} - -<# - .SYNOPSIS - Creates and throws an object not found exception. - - .PARAMETER Message - The message explaining why this error is being thrown. - - .PARAMETER ErrorRecord - The error record containing the exception that is causing this terminating error. -#> -function New-ObjectNotFoundException -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Message, - - [Parameter()] - [ValidateNotNull()] - [System.Management.Automation.ErrorRecord] - $ErrorRecord - ) - - if ($null -eq $ErrorRecord) - { - $exception = New-Object -TypeName 'System.Exception' ` - -ArgumentList @($Message) - } - else - { - $exception = New-Object -TypeName 'System.Exception' ` - -ArgumentList @($Message, $ErrorRecord.Exception) - } - - $newObjectParameters = @{ - TypeName = 'System.Management.Automation.ErrorRecord' - ArgumentList = @( - $exception.ToString(), - 'MachineStateIncorrect', - 'ObjectNotFound', - $null - ) - } - - $errorRecordToThrow = New-Object @newObjectParameters - - throw $errorRecordToThrow -} +$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules' +Import-Module -Name (Join-Path -Path $modulePath -ChildPath 'DscResource.Common') -<# - .SYNOPSIS - Creates and throws an invalid result exception. - - .PARAMETER Message - The message explaining why this error is being thrown. - - .PARAMETER ErrorRecord - The error record containing the exception that is causing this terminating error. -#> -function New-InvalidResultException -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Message, - - [Parameter()] - [ValidateNotNull()] - [System.Management.Automation.ErrorRecord] - $ErrorRecord - ) - - if ($null -eq $ErrorRecord) - { - $exception = New-Object -TypeName 'System.Exception' ` - -ArgumentList @($Message) - } - else - { - $exception = New-Object -TypeName 'System.Exception' ` - -ArgumentList @($Message, $ErrorRecord.Exception) - } - - $newObjectParameters = @{ - TypeName = 'System.Management.Automation.ErrorRecord' - ArgumentList = @( - $exception.ToString(), - 'MachineStateIncorrect', - 'InvalidResult', - $null - ) - } - - $errorRecordToThrow = New-Object @newObjectParameters - - throw $errorRecordToThrow -} +# Import Localization Strings +$script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' <# .SYNOPSIS @@ -305,166 +52,6 @@ function Start-ProcessWithTimeout return $sqlSetupProcess.ExitCode } -<# - .SYNOPSIS - Assert if the role specific module is installed or not and optionally - import it. - - .PARAMETER ModuleName - The name of the module to assert is installed. - - .PARAMETER ImportModule - This switch causes the module to be imported if it is installed. -#> -function Assert-Module -{ - [CmdletBinding()] - param - ( - [Parameter()] - [ValidateNotNullOrEmpty()] - [System.String] - $ModuleName = 'WebAdministration', - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $ImportModule - ) - - if (-not (Get-Module -Name $ModuleName -ListAvailable)) - { - $errorMessage = $script:localizedData.ModuleNotFoundError -f $moduleName - New-ObjectNotFoundException -Message $errorMessage - } - - if ($ImportModule) - { - Import-Module -Name $ModuleName - } -} #end function Assert-Module - -<# - .SYNOPSIS - This function is used to compare current and desired values for any DSC - resource, and return a hashtable with the result from the comparison. - - .PARAMETER CurrentValues - The current values that should be compared to to desired values. Normally - the values returned from Get-TargetResource. - - .PARAMETER DesiredValues - The values set in the configuration and is provided in the call to the - functions *-TargetResource, and that will be compared against current - values. Normally set to $PSBoundParameters. - - .PARAMETER Properties - An array of property names, from the keys provided in DesiredValues, that - will be compared. If this parameter is left out, all the keys in the - DesiredValues will be compared. -#> -function Compare-ResourcePropertyState -{ - [CmdletBinding()] - [OutputType([System.Collections.Hashtable[]])] - param - ( - [Parameter(Mandatory = $true)] - [System.Collections.Hashtable] - $CurrentValues, - - [Parameter(Mandatory = $true)] - [System.Collections.Hashtable] - $DesiredValues, - - [Parameter()] - [System.String[]] - $Properties, - - [Parameter()] - [System.String[]] - $IgnoreProperties - ) - - if ($PSBoundParameters.ContainsKey('Properties')) - { - # Filter out the parameters (keys) not specified in Properties - $desiredValuesToRemove = $DesiredValues.Keys | - Where-Object -FilterScript { - $_ -notin $Properties - } - - $desiredValuesToRemove | - ForEach-Object -Process { - $DesiredValues.Remove($_) - } - } - else - { - <# - Remove any common parameters that might be part of DesiredValues, - if it $PSBoundParameters was used to pass the desired values. - #> - $commonParametersToRemove = $DesiredValues.Keys | - Where-Object -FilterScript { - $_ -in [System.Management.Automation.PSCmdlet]::CommonParameters ` - -or $_ -in [System.Management.Automation.PSCmdlet]::OptionalCommonParameters - } - - $commonParametersToRemove | - ForEach-Object -Process { - $DesiredValues.Remove($_) - } - } - - # Remove any properties that should be ignored. - if ($PSBoundParameters.ContainsKey('IgnoreProperties')) - { - $IgnoreProperties | - ForEach-Object -Process { - if ($DesiredValues.ContainsKey($_)) - { - $DesiredValues.Remove($_) - } - } - } - - $compareTargetResourceStateReturnValue = @() - - foreach ($parameterName in $DesiredValues.Keys) - { - Write-Verbose -Message ($script:localizedData.EvaluatePropertyState -f $parameterName) -Verbose - - $parameterState = @{ - ParameterName = $parameterName - Expected = $DesiredValues.$parameterName - Actual = $CurrentValues.$parameterName - } - - # Check if the parameter is in compliance. - $isPropertyInDesiredState = Test-DscPropertyState -Values @{ - CurrentValue = $CurrentValues.$parameterName - DesiredValue = $DesiredValues.$parameterName - } - - if ($isPropertyInDesiredState) - { - Write-Verbose -Message ($script:localizedData.PropertyInDesiredState -f $parameterName) -Verbose - - $parameterState['InDesiredState'] = $true - } - else - { - Write-Verbose -Message ($script:localizedData.PropertyNotInDesiredState -f $parameterName) -Verbose - - $parameterState['InDesiredState'] = $false - } - - $compareTargetResourceStateReturnValue += $parameterState - } - - return $compareTargetResourceStateReturnValue -} - <# .SYNOPSIS This function is used to compare the current and the desired value of a @@ -854,5 +441,3 @@ function Get-WebConfigurationPropertyValue return $WebConfigurationPropertyObject } } - -$script:localizedData = Get-LocalizedData -ResourceName 'xWebAdministration.Common' -ScriptRoot $PSScriptRoot diff --git a/source/Modules/xWebAdministration.Common/en-US/xWebAdministration.Common.strings.psd1 b/source/Modules/WebAdministrationDsc.Common/en-US/WebAdministrationDsc.Common.strings.psd1 similarity index 64% rename from source/Modules/xWebAdministration.Common/en-US/xWebAdministration.Common.strings.psd1 rename to source/Modules/WebAdministrationDsc.Common/en-US/WebAdministrationDsc.Common.strings.psd1 index b5473bee0..9c5dedb29 100644 --- a/source/Modules/xWebAdministration.Common/en-US/xWebAdministration.Common.strings.psd1 +++ b/source/Modules/WebAdministrationDsc.Common/en-US/WebAdministrationDsc.Common.strings.psd1 @@ -1,14 +1,10 @@ -# Localized resources for helper module xWebAdministration.Common. +# Localized resources for helper module WebAdministrationDsc.Common. ConvertFrom-StringData @' - EvaluatePropertyState = Evaluating the state of the property '{0}'. (WACOMMON0001) - PropertyInDesiredState = The parameter '{0}' is in desired state. (WACOMMON0002) - PropertyNotInDesiredState = The parameter '{0}' is not in desired state. (WACOMMON0003) ArrayDoesNotMatch = One or more values in an array does not match the desired state. Details of the changes are below. (WACOMMON0004) ArrayValueThatDoesNotMatch = {0} - {1} (WACOMMON0005) PropertyValueOfTypeDoesNotMatch = {0} value does not match. Current value is '{1}', but expected the value '{2}'. (WACOMMON0006) UnableToCompareType = Unable to compare the type {0} as it is not handled by the Test-DscPropertyState cmdlet. (WACOMMON0007) - ModuleNotFoundError = Please ensure that the PowerShell module for role '{0}' is installed. (WACOMMON0008) StartProcess = Started the process with id {0} using the path '{1}', and with a timeout value of {2} seconds. (WACOMMON0009) CertificatePathError = Certificate Path '{0}' is not valid. (WACOMMON0010) SearchingForCertificateUsingFilters = Looking for certificate in Store '{0}' using filter '{1}'. (WACOMMON0011) diff --git a/source/xWebAdministration.psd1 b/source/WebAdministrationDsc.psd1 similarity index 91% rename from source/xWebAdministration.psd1 rename to source/WebAdministrationDsc.psd1 index 8f6bb0fca..637abae30 100644 --- a/source/xWebAdministration.psd1 +++ b/source/WebAdministrationDsc.psd1 @@ -47,10 +47,10 @@ Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResourceKit', 'DSCResource') # A URL to the license for this module. - LicenseUri = 'https://github.com/dsccommunity/xWebAdministration/blob/main/LICENSE' + LicenseUri = 'https://github.com/dsccommunity/WebAdministrationDsc/blob/main/LICENSE' # A URL to the main website for this project. - ProjectUri = 'https://github.com/dsccommunity/xWebAdministration' + ProjectUri = 'https://github.com/dsccommunity/WebAdministrationDsc' # A URL to an icon representing this module. IconUri = 'https://dsccommunity.org/images/DSC_Logo_300p.png' diff --git a/source/xWebAdministration.psm1 b/source/WebAdministrationDsc.psm1 similarity index 99% rename from source/xWebAdministration.psm1 rename to source/WebAdministrationDsc.psm1 index 611f306af..c08d599f2 100644 --- a/source/xWebAdministration.psm1 +++ b/source/WebAdministrationDsc.psm1 @@ -2,4 +2,3 @@ This file is intentionally left empty. It is must be left here for the module manifest to refe to. It is recreated during the build process. #> - diff --git a/source/WikiSource/Home.md b/source/WikiSource/Home.md index 5d9717cfc..bb957893e 100644 --- a/source/WikiSource/Home.md +++ b/source/WikiSource/Home.md @@ -1,14 +1,14 @@ -# Welcome to the xWebAdministration wiki +# Welcome to the WebAdministrationDsc wiki -*xWebAdministration v#.#.#* +*WebAdministrationDsc v#.#.#* -Here you will find all the information you need to make use of the xWebAdministration +Here you will find all the information you need to make use of the WebAdministrationDsc DSC resources in the latest release. This includes details of the resources that are available, current capabilities and known issues, and information -to help plan a DSC based implementation of xWebAdministration. +to help plan a DSC based implementation of WebAdministrationDsc. Please leave comments, feature requests, and bug reports for this module in -the [issues section](https://github.com/dsccommunity/xWebAdministration/issues) +the [issues section](https://github.com/dsccommunity/WebAdministrationDsc/issues) for this repository. ## Deprecated resources @@ -27,18 +27,18 @@ To get started either: following command: ```powershell -Install-Module -Name xWebAdministration -Repository PSGallery +Install-Module -Name WebAdministrationDsc -Repository PSGallery ``` -- Download xWebAdministration from the [PowerShell Gallery](http://www.powershellgallery.com/packages/xWebAdministration/) +- Download WebAdministrationDsc from the [PowerShell Gallery](http://www.powershellgallery.com/packages/WebAdministrationDsc/) and then unzip it to one of your PowerShell modules folders (such as `$env:ProgramFiles\WindowsPowerShell\Modules`). -To confirm installation, run the below command and ensure you see the xWebAdministration +To confirm installation, run the below command and ensure you see the WebAdministrationDsc DSC resources available: ```powershell -Get-DscResource -Module xWebAdministration +Get-DscResource -Module WebAdministrationDsc ``` ## Prerequisites @@ -52,4 +52,4 @@ and Windows Server 2012 R2. ## Change log -A full list of changes in each version can be found in the [change log](https://github.com/dsccommunity/xWebAdministration/blob/main/CHANGELOG.md). +A full list of changes in each version can be found in the [change log](https://github.com/dsccommunity/WebAdministrationDsc/blob/main/CHANGELOG.md). diff --git a/source/build.psd1 b/source/build.psd1 deleted file mode 100644 index 7e48c697e..000000000 --- a/source/build.psd1 +++ /dev/null @@ -1,4 +0,0 @@ -@{ - Path = 'xWebAdministration.psd1' -} - diff --git a/source/en-US/about_xWebAdministration.help.txt b/source/en-US/about_xWebAdministration.help.txt index 30f98a3de..ab380508f 100644 --- a/source/en-US/about_xWebAdministration.help.txt +++ b/source/en-US/about_xWebAdministration.help.txt @@ -1,5 +1,5 @@ TOPIC - about_xWebAdministration + about_WebAdministrationDsc SHORT DESCRIPTION DSC resources for configuring web servers and related components. @@ -8,7 +8,7 @@ LONG DESCRIPTION This module contains DSC resources for deploying and configuring web servers and related components. EXAMPLES - PS C:\> Get-DscResource -Module about_xWebAdministration + PS C:\> Get-DscResource -Module about_WebAdministrationDsc NOTE: Thank you to the DSC Community contributors who contributed to this module by @@ -16,11 +16,10 @@ NOTE: TROUBLESHOOTING NOTE: Go to the Github repository for read about issues, submit a new issue, and read - about new releases. https://github.com/dsccommunity/xWebAdministration + about new releases. https://github.com/dsccommunity/WebAdministrationDsc SEE ALSO - - https://github.com/dsccommunity/xWebAdministration + - https://github.com/dsccommunity/WebAdministrationDsc KEYWORDS DSC, DscResource, IIS - diff --git a/tests/Integration/MSFT_xIISFeatureDelegation.Integration.Tests.ps1 b/tests/Integration/DSC_IISFeatureDelegation.Integration.Tests.ps1 similarity index 95% rename from tests/Integration/MSFT_xIISFeatureDelegation.Integration.Tests.ps1 rename to tests/Integration/DSC_IISFeatureDelegation.Integration.Tests.ps1 index 49762c9ac..d4414893d 100644 --- a/tests/Integration/MSFT_xIISFeatureDelegation.Integration.Tests.ps1 +++ b/tests/Integration/DSC_IISFeatureDelegation.Integration.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xIISFeatureDelegation' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_IisFeatureDelegation' try { @@ -71,7 +71,7 @@ try $resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript { $_.ConfigurationName -eq $configurationName } | Where-Object -FilterScript { - $_.ResourceId -eq '[xIisFeatureDelegation]AllowDelegation' + $_.ResourceId -eq '[IisFeatureDelegation]AllowDelegation' } $resourceCurrentState.Filter | Should Be '/system.web/customErrors' @@ -121,7 +121,7 @@ try $resourceCurrentState = $script:currentConfiguration | Where-Object -FilterScript { $_.ConfigurationName -eq $configurationName } | Where-Object -FilterScript { - $_.ResourceId -eq '[xIisFeatureDelegation]DenyDelegation' + $_.ResourceId -eq '[IisFeatureDelegation]DenyDelegation' } $resourceCurrentState.Filter | Should Be '/system.webServer/defaultDocument' diff --git a/tests/Integration/DSC_IISFeatureDelegation.config.ps1 b/tests/Integration/DSC_IISFeatureDelegation.config.ps1 new file mode 100644 index 000000000..c3f118d43 --- /dev/null +++ b/tests/Integration/DSC_IISFeatureDelegation.config.ps1 @@ -0,0 +1,23 @@ +configuration DSC_IisFeatureDelegation_AllowDelegation +{ + Import-DscResource -ModuleName WebAdministrationDsc + + IisFeatureDelegation AllowDelegation + { + Path = 'MACHINE/WEBROOT/APPHOST' + Filter = '/system.web/customErrors' + OverrideMode = 'Allow' + } +} + +configuration DSC_IisFeatureDelegation_DenyDelegation +{ + Import-DscResource -ModuleName WebAdministrationDsc + + IisFeatureDelegation DenyDelegation + { + Path = 'MACHINE/WEBROOT/APPHOST' + Filter = '/system.webServer/defaultDocument' + OverrideMode = 'Deny' + } +} diff --git a/tests/Integration/MSFT_XIISLogging.Integration.Tests.ps1 b/tests/Integration/DSC_IISLogging.Integration.Tests.ps1 similarity index 98% rename from tests/Integration/MSFT_XIISLogging.Integration.Tests.ps1 rename to tests/Integration/DSC_IISLogging.Integration.Tests.ps1 index 3978f0bc0..12859ea82 100644 --- a/tests/Integration/MSFT_XIISLogging.Integration.Tests.ps1 +++ b/tests/Integration/DSC_IISLogging.Integration.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xIISLogging' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_IisLogging' try { diff --git a/tests/Integration/MSFT_XIISLogging.config.ps1 b/tests/Integration/DSC_IISLogging.config.ps1 similarity index 77% rename from tests/Integration/MSFT_XIISLogging.config.ps1 rename to tests/Integration/DSC_IISLogging.config.ps1 index 1efc36696..2bb050397 100644 --- a/tests/Integration/MSFT_XIISLogging.config.ps1 +++ b/tests/Integration/DSC_IISLogging.config.ps1 @@ -1,8 +1,8 @@ -configuration MSFT_xIisLogging_Rollover +configuration DSC_IisLogging_Rollover { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIisLogging Logging + IisLogging Logging { LogPath = 'C:\IISLogFiles' Logflags = @('Date','Time','ClientIP','UserName','ServerIP') @@ -11,13 +11,13 @@ configuration MSFT_xIisLogging_Rollover LogFormat = 'W3C' LogTargetW3C = 'File,ETW' LogCustomFields = @( - MSFT_xLogCustomField + DSC_LogCustomField { LogFieldName = 'ClientEncoding' SourceName = 'Accept-Encoding' SourceType = 'RequestHeader' } - MSFT_xLogCustomField + DSC_LogCustomField { LogFieldName = 'X-Powered-By' SourceName = 'ASP.NET' @@ -27,11 +27,11 @@ configuration MSFT_xIisLogging_Rollover } } -configuration MSFT_xIisLogging_Truncate +configuration DSC_IisLogging_Truncate { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIisLogging Logging + IisLogging Logging { LogPath = 'C:\IISLogFiles' Logflags = @('Date','Time','ClientIP','UserName','ServerIP') @@ -40,13 +40,13 @@ configuration MSFT_xIisLogging_Truncate LogFormat = 'W3C' LogTargetW3C = 'File,ETW' LogCustomFields = @( - MSFT_xLogCustomField + DSC_LogCustomField { LogFieldName = 'ClientEncoding' SourceName = 'Accept-Encoding' SourceType = 'RequestHeader' } - MSFT_xLogCustomField + DSC_LogCustomField { LogFieldName = 'X-Powered-By' SourceName = 'ASP.NET' @@ -56,11 +56,11 @@ configuration MSFT_xIisLogging_Truncate } } -configuration MSFT_xIisLogging_LogFlags +configuration DSC_IisLogging_LogFlags { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIisLogging Logging + IisLogging Logging { LogPath = 'C:\IISLogFiles' Logflags = @('Date','Time','ClientIP','ServerIP','UserAgent') @@ -69,13 +69,13 @@ configuration MSFT_xIisLogging_LogFlags LogFormat = 'W3C' LogTargetW3C = 'File,ETW' LogCustomFields = @( - MSFT_xLogCustomField + DSC_LogCustomField { LogFieldName = 'ClientEncoding' SourceName = 'Accept-Encoding' SourceType = 'RequestHeader' } - MSFT_xLogCustomField + DSC_LogCustomField { LogFieldName = 'X-Powered-By' SourceName = 'ASP.NET' @@ -83,4 +83,4 @@ configuration MSFT_xIisLogging_LogFlags } ) } -} \ No newline at end of file +} diff --git a/tests/Integration/MSFT_xIISMimeTypeMapping.Integration.Tests.ps1 b/tests/Integration/DSC_IISMimeTypeMapping.Integration.Tests.ps1 similarity index 95% rename from tests/Integration/MSFT_xIISMimeTypeMapping.Integration.Tests.ps1 rename to tests/Integration/DSC_IISMimeTypeMapping.Integration.Tests.ps1 index 22f98dbc1..17def19c1 100644 --- a/tests/Integration/MSFT_xIISMimeTypeMapping.Integration.Tests.ps1 +++ b/tests/Integration/DSC_IISMimeTypeMapping.Integration.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xIISMimeTypeMapping' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_IisMimeTypeMapping' try { @@ -33,15 +33,15 @@ try #region Test Setup $tempVirtualDirectoryName = 'Dir01' $tempVirtualDirectoryPhysicalPath = Join-Path $TestDrive "inetpub\wwwroot\$tempVirtualDirectoryName" - $tempVirtualDirectoryIisPath = "IIS:\Sites\WebsiteForxIisMimeTypeMapping\$tempVirtualDirectoryName" + $tempVirtualDirectoryIisPath = "IIS:\Sites\WebsiteForIisMimeTypeMapping\$tempVirtualDirectoryName" - New-Website -Name 'WebsiteForxIisMimeTypeMapping' ` + New-Website -Name 'WebsiteForIisMimeTypeMapping' ` -PhysicalPath (Join-Path $TestDrive 'inetpub\wwwroot\') ` -Force ` -ErrorAction Stop New-Item -Path $tempVirtualDirectoryPhysicalPath -ItemType Directory | Out-Null - New-WebVirtualDirectory -Site 'WebsiteForxIisMimeTypeMapping' -Name $tempVirtualDirectoryName -PhysicalPath $tempVirtualDirectoryPhysicalPath + New-WebVirtualDirectory -Site 'WebsiteForIisMimeTypeMapping' -Name $tempVirtualDirectoryName -PhysicalPath $tempVirtualDirectoryPhysicalPath #endregion $configData = @{ diff --git a/tests/Integration/MSFT_xIISMimeTypeMapping.config.ps1 b/tests/Integration/DSC_IISMimeTypeMapping.config.ps1 similarity index 62% rename from tests/Integration/MSFT_xIISMimeTypeMapping.config.ps1 rename to tests/Integration/DSC_IISMimeTypeMapping.config.ps1 index f9914e9a3..cd94f40f7 100644 --- a/tests/Integration/MSFT_xIISMimeTypeMapping.config.ps1 +++ b/tests/Integration/DSC_IISMimeTypeMapping.config.ps1 @@ -1,8 +1,8 @@ -configuration MSFT_xIISMimeTypeMapping_AddMimeType +configuration DSC_IisMimeTypeMapping_AddMimeType { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIISMimeTypeMapping AddMimeType2 + IisMimeTypeMapping AddMimeType2 { ConfigurationPath = '' Extension = $ConfigurationData.NonNodeData.FileExtension @@ -11,11 +11,11 @@ configuration MSFT_xIISMimeTypeMapping_AddMimeType } } -configuration MSFT_xIISMimeTypeMapping_RemoveMimeType +configuration DSC_IisMimeTypeMapping_RemoveMimeType { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIISMimeTypeMapping RemoveMimeType + IisMimeTypeMapping RemoveMimeType { ConfigurationPath = '' Extension = $ConfigurationData.NonNodeData.FileExtension @@ -24,11 +24,11 @@ configuration MSFT_xIISMimeTypeMapping_RemoveMimeType } } -Configuration MSFT_xIISMimeTypeMapping_AddMimeTypeNestedPath +Configuration DSC_IisMimeTypeMapping_AddMimeTypeNestedPath { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIISMimeTypeMapping AddMimeTypeNestedPath + IisMimeTypeMapping AddMimeTypeNestedPath { ConfigurationPath = $ConfigurationData.NonNodeData.VirtualConfigurationPath Extension = $ConfigurationData.NonNodeData.FileExtension @@ -37,11 +37,11 @@ Configuration MSFT_xIISMimeTypeMapping_AddMimeTypeNestedPath } } -Configuration MSFT_xIISMimeTypeMapping_RemoveMimeTypeNestedPath +Configuration DSC_IisMimeTypeMapping_RemoveMimeTypeNestedPath { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIISMimeTypeMapping RemoveMimeTypeNestedPath + IisMimeTypeMapping RemoveMimeTypeNestedPath { ConfigurationPath = $ConfigurationData.NonNodeData.VirtualConfigurationPath Extension = $ConfigurationData.NonNodeData.FileExtension @@ -50,11 +50,11 @@ Configuration MSFT_xIISMimeTypeMapping_RemoveMimeTypeNestedPath } } -Configuration MSFT_xIISMimeTypeMapping_AddMimeTypeAtServer +Configuration DSC_IisMimeTypeMapping_AddMimeTypeAtServer { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIISMimeTypeMapping AddMimeTypeAtServer + IisMimeTypeMapping AddMimeTypeAtServer { ConfigurationPath = $ConfigurationData.NonNodeData.ServerConfigurationPath Extension = $ConfigurationData.NonNodeData.FileExtension @@ -63,11 +63,11 @@ Configuration MSFT_xIISMimeTypeMapping_AddMimeTypeAtServer } } -Configuration MSFT_xIISMimeTypeMapping_RemoveMimeTypeAtServer +Configuration DSC_IisMimeTypeMapping_RemoveMimeTypeAtServer { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xIISMimeTypeMapping AddMimeTypeAtServer + IisMimeTypeMapping AddMimeTypeAtServer { ConfigurationPath = $ConfigurationData.NonNodeData.ServerConfigurationPath Extension = $ConfigurationData.NonNodeData.FileExtension diff --git a/tests/Integration/MSFT_xSslSettings.Integration.Tests.ps1 b/tests/Integration/DSC_SslSettings.Integration.Tests.ps1 similarity index 95% rename from tests/Integration/MSFT_xSslSettings.Integration.Tests.ps1 rename to tests/Integration/DSC_SslSettings.Integration.Tests.ps1 index e92459779..74f226c69 100644 --- a/tests/Integration/MSFT_xSslSettings.Integration.Tests.ps1 +++ b/tests/Integration/DSC_SslSettings.Integration.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xSslSettings' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_SslSettings' try { @@ -24,7 +24,7 @@ try { $null = Backup-WebConfiguration -Name $tempName - # Now that xWebAdministration should be discoverable load the configuration data + # Now that WebAdministrationDsc should be discoverable load the configuration data $configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" . $configFile diff --git a/tests/Integration/MSFT_xSslSettings.config.ps1 b/tests/Integration/DSC_SslSettings.config.ps1 similarity index 58% rename from tests/Integration/MSFT_xSslSettings.config.ps1 rename to tests/Integration/DSC_SslSettings.config.ps1 index e0e5673e5..db8c5d698 100644 --- a/tests/Integration/MSFT_xSslSettings.config.ps1 +++ b/tests/Integration/DSC_SslSettings.config.ps1 @@ -1,12 +1,12 @@ #requires -Version 4 -configuration MSFT_xSslSettings_Present +configuration DSC_SslSettings_Present { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xSslSettings Website + SslSettings Website { Ensure = 'Present' Name = $Node.Website @@ -15,13 +15,13 @@ configuration MSFT_xSslSettings_Present } } -configuration MSFT_xSslSettings_Absent +configuration DSC_SslSettings_Absent { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xSslSettings Website + SslSettings Website { Ensure = 'Absent' Name = $Node.Website diff --git a/tests/Integration/MSFT_xSslSettings.config.psd1 b/tests/Integration/DSC_SslSettings.config.psd1 similarity index 100% rename from tests/Integration/MSFT_xSslSettings.config.psd1 rename to tests/Integration/DSC_SslSettings.config.psd1 diff --git a/tests/Integration/MSFT_xWebAppPool.Integration.Tests.ps1 b/tests/Integration/DSC_WebAppPool.Integration.Tests.ps1 similarity index 71% rename from tests/Integration/MSFT_xWebAppPool.Integration.Tests.ps1 rename to tests/Integration/DSC_WebAppPool.Integration.Tests.ps1 index f31738eb2..401b38ffa 100644 --- a/tests/Integration/MSFT_xWebAppPool.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WebAppPool.Integration.Tests.ps1 @@ -1,7 +1,7 @@ #requires -Version 4.0 -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebAppPool' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebAppPool' try { @@ -41,23 +41,43 @@ try Describe "$($script:dscResourceName)_Integration" { - #region Default Tests + $ConfigData = @{ + AllNodes = @( + @{ + NodeName = '*' + PSDscAllowPlainTextPassword = $true + } + @{ + NodeName = 'localhost' + } + ) + } - It 'Should be able to compile and apply without throwing' { + #region Default Tests + It 'Should compile the MOF without throwing' { { - Invoke-Expression -Command ( - '{0}_Config -OutputPath $TestDrive -ConfigurationData $ConfigData -ErrorAction Stop' -f - $script:dscResourceName - ) + & "$($script:DSCResourceName)_Integration" ` + -OutputPath $TestDrive ` + -ConfigurationData $ConfigData + } | Should -Not -Throw + } - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Force -Wait -Verbose - } | Should Not Throw + It 'Should apply the MOF without throwing' { + { + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw } It 'Should be able to call Get-DscConfiguration without throwing' { - { - Get-DscConfiguration -Verbose -ErrorAction Stop - } | Should Not Throw + { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw } #endregion diff --git a/tests/Integration/MSFT_xWebAppPool.config.ps1 b/tests/Integration/DSC_WebAppPool.config.ps1 similarity index 98% rename from tests/Integration/MSFT_xWebAppPool.config.ps1 rename to tests/Integration/DSC_WebAppPool.config.ps1 index d9a2b369b..2d05f383b 100644 --- a/tests/Integration/MSFT_xWebAppPool.config.ps1 +++ b/tests/Integration/DSC_WebAppPool.config.ps1 @@ -75,13 +75,13 @@ $TestParameters = [Ordered]@{ restartSchedule = @('06:00:00', '08:00:00') } -Configuration MSFT_xWebAppPool_Config +Configuration DSC_WebAppPool_Integration { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xWebAppPool TestAppPool + WebAppPool TestAppPool { Name = $TestParameters.Name Ensure = $TestParameters.Ensure diff --git a/tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1 b/tests/Integration/DSC_WebAppPoolDefaults.Integration.Tests.ps1 similarity index 98% rename from tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1 rename to tests/Integration/DSC_WebAppPoolDefaults.Integration.Tests.ps1 index e4b4ffa1e..4e7504974 100644 --- a/tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WebAppPoolDefaults.Integration.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebAppPoolDefaults' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebAppPoolDefaults' try { diff --git a/tests/Integration/MSFT_xWebAppPoolDefaults.config.ps1 b/tests/Integration/DSC_WebAppPoolDefaults.config.ps1 similarity index 54% rename from tests/Integration/MSFT_xWebAppPoolDefaults.config.ps1 rename to tests/Integration/DSC_WebAppPoolDefaults.config.ps1 index 2ccd88528..e42c6b6c5 100644 --- a/tests/Integration/MSFT_xWebAppPoolDefaults.config.ps1 +++ b/tests/Integration/DSC_WebAppPoolDefaults.config.ps1 @@ -4,55 +4,55 @@ [string] $originalValue = (Get-WebConfigurationProperty -pspath $constPsPath -filter $constAPDFilter -name managedRuntimeVersion).Value -configuration MSFT_xWebAppPoolDefaults_Config +configuration DSC_WebAppPoolDefaults_Config { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xWebAppPoolDefaults PoolDefaults + WebAppPoolDefaults PoolDefaults { IsSingleInstance = 'Yes' ManagedRuntimeVersion = $originalValue } } -configuration MSFT_xWebAppPoolDefaults_ManagedRuntimeVersion +configuration DSC_WebAppPoolDefaults_ManagedRuntimeVersion { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xWebAppPoolDefaults PoolDefaults + WebAppPoolDefaults PoolDefaults { IsSingleInstance = 'Yes' ManagedRuntimeVersion = $env:PesterManagedRuntimeVersion } } -configuration MSFT_xWebAppPoolDefaults_AppPoolIdentityType +configuration DSC_WebAppPoolDefaults_AppPoolIdentityType { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xWebAppPoolDefaults PoolDefaults + WebAppPoolDefaults PoolDefaults { IsSingleInstance = 'Yes' IdentityType = $env:PesterApplicationPoolIdentity } } -configuration MSFT_xWebAppPoolDefaults_LogFormat +configuration DSC_WebAppPoolDefaults_LogFormat { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xWebSiteDefaults LogFormat + WebSiteDefaults LogFormat { IsSingleInstance = 'Yes' LogFormat = $env:PesterLogFormat } } -configuration MSFT_xWebAppPoolDefaults_DefaultPool +configuration DSC_WebAppPoolDefaults_DefaultPool { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xWebSiteDefaults DefaultPool + WebSiteDefaults DefaultPool { IsSingleInstance = 'Yes' DefaultApplicationPool = $env:PesterDefaultPool diff --git a/tests/Integration/DSC_WebApplication.Integration.Tests.ps1 b/tests/Integration/DSC_WebApplication.Integration.Tests.ps1 new file mode 100644 index 000000000..39583caed --- /dev/null +++ b/tests/Integration/DSC_WebApplication.Integration.Tests.ps1 @@ -0,0 +1,191 @@ +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebApplication' + +try +{ + Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' +} +catch [System.IO.FileNotFoundException] +{ + throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.' +} + +$script:testEnvironment = Initialize-TestEnvironment ` + -DSCModuleName $script:dscModuleName ` + -DSCResourceName $script:dscResourceName ` + -ResourceType 'Mof' ` + -TestType 'Integration' + +Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') + +$tempName = "$($script:dscResourceName)_" + (Get-Date).ToString('yyyyMMdd_HHmmss') + +try +{ + $null = Backup-WebConfiguration -Name $tempName + + # Now that WebAdministrationDsc should be discoverable load the configuration data + $ConfigFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" + . $ConfigFile + + $configData = Import-LocalizedData -BaseDirectory $PSScriptRoot -FileName "$($script:dscResourceName).config.psd1" + + #region HelperFunctions + + # Function needed to test AuthenticationInfo + function Get-AuthenticationInfo ($Type, $Website, $WebApplication) + { + (Get-WebConfigurationProperty ` + -Filter /system.WebServer/security/authentication/${Type}Authentication ` + -Name enabled ` + -Location "${Website}/${WebApplication}").Value + } + + # Function needed to test SslFlags + function Get-SslFlags ($Website, $WebApplication) + { + Get-WebConfiguration ` + -PSPath IIS:\Sites ` + -Location "${Website}/${WebApplication}" ` + -Filter 'system.webserver/security/access' | ` + ForEach-Object { $_.sslFlags } + } + + #endregion + + # Create a new website for the WebApplication + + New-Website -Name $configData.AllNodes.Website ` + -Id 100 ` + -PhysicalPath $configData.AllNodes.PhysicalPath ` + -ApplicationPool $configData.AllNodes.AppPool ` + -SslFlags $configData.AllNodes.SslFlags ` + -Port $configData.AllNodes.HTTPSPort ` + -IPAddress '*' ` + -HostHeader $configData.AllNodes.HTTPSHostname ` + -Ssl ` + -Force ` + -ErrorAction Stop + + Describe "$($script:dscResourceName)_Present" { + #region DEFAULT TESTS + It 'Should compile the MOF without throwing' { + { + & "$($script:DSCResourceName)_Present" ` + -OutputPath $TestDrive ` + -ConfigurationData $configData + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { + { + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw + } + + <# + This is throwing, issue created: https://github.com/dsccommunity/WebAdministrationDsc/issues/606 + #> + # It 'Should be able to call Get-DscConfiguration without throwing' { + # { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw + # } + #endregion + + It 'Should create a WebApplication with correct settings' -test { + + Invoke-Expression -Command "$($script:dscResourceName)_Present -ConfigurationData `$DSCConfg -OutputPath `$TestDrive" + + # Build results to test + $Result = Get-WebApplication -Site $configData.AllNodes.Website -Name $configData.AllNodes.WebApplication + $ServiceAutoStartProviders = (Get-WebConfiguration -filter /system.applicationHost/serviceAutoStartProviders).Collection + + # Test WebApplication basic settings are correct + $Result.Path | Should Match $configData.AllNodes.WebApplication + $Result.PhysicalPath | Should Be $configData.AllNodes.PhysicalPath + $Result.ApplicationPool | Should Be $configData.AllNodes.ApplicationPool + + # Test Website AuthenticationInfo are correct + Get-AuthenticationInfo -Type 'Anonymous' -Website $configData.AllNodes.Website -WebApplication $configData.AllNodes.WebApplication | Should Be $configData.AllNodes.AuthenticationInfoAnonymous + Get-AuthenticationInfo -Type 'Basic' -Website $configData.AllNodes.Website -WebApplication $configData.AllNodes.WebApplication | Should Be $configData.AllNodes.AuthenticationInfoBasic + Get-AuthenticationInfo -Type 'Digest' -Website $configData.AllNodes.Website -WebApplication $configData.AllNodes.WebApplication | Should Be $configData.AllNodes.AuthenticationInfoDigest + Get-AuthenticationInfo -Type 'Windows' -Website $configData.AllNodes.Website -WebApplication $configData.AllNodes.WebApplication | Should Be $configData.AllNodes.AuthenticationInfoWindows + + # Test WebApplication settings + $Result.PreloadEnabled | Should Be $configData.AllNodes.PreloadEnabled + $Result.ServiceAutoStartProvider | Should Be $configData.AllNodes.ServiceAutoStartProvider + $Result.ServiceAutoStartEnabled | Should Be $configData.AllNodes.ServiceAutoStartEnabled + + # Test the serviceAutoStartProviders are present in IIS config + $ServiceAutoStartProviders.Name | Should Be $configData.AllNodes.ServiceAutoStartProvider + $ServiceAutoStartProviders.Type | Should Be $configData.AllNodes.ApplicationType + + # Test WebApplication SslFlags + Get-SslFlags -Website $configData.AllNodes.Website -WebApplication $configData.AllNodes.WebApplication | Should Be $configData.AllNodes.WebApplicationSslFlags + + # Test EnabledProtocols + $Result.EnabledProtocols | Should Be ($configData.AllNodes.EnabledProtocols -join ',') + + } + + } + + Describe "$($script:dscResourceName)_Absent" { + #region DEFAULT TESTS + It 'Should compile the MOF without throwing' { + { + & "$($script:DSCResourceName)_Absent" ` + -OutputPath $TestDrive ` + -ConfigurationData $configData + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { + { + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw + } + + <# + This is throwing, issue created: https://github.com/dsccommunity/WebAdministrationDsc/issues/606 + #> + # It 'Should be able to call Get-DscConfiguration without throwing' { + # { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw + # } + #endregion + + It 'Should remove the WebApplication' -test { + Invoke-Expression -Command "$($script:dscResourceName)_Absent -ConfigurationData `$DSCConfg -OutputPath `$TestDrive" + + # Build results to test + $Result = Get-WebApplication -Site $configData.AllNodes.Website -Name $configData.AllNodes.WebApplication + + # Test WebApplication is removed + $Result | Should BeNullOrEmpty + } + + } +} +finally +{ + Restore-WebConfigurationWrapper -Name $tempName -Verbose + + Remove-WebConfigurationBackup -Name $tempName -Verbose + + Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose +} diff --git a/tests/Integration/MSFT_xWebApplication.config.ps1 b/tests/Integration/DSC_WebApplication.config.ps1 similarity index 75% rename from tests/Integration/MSFT_xWebApplication.config.ps1 rename to tests/Integration/DSC_WebApplication.config.ps1 index 81ffeee52..cc7cbc92e 100644 --- a/tests/Integration/MSFT_xWebApplication.config.ps1 +++ b/tests/Integration/DSC_WebApplication.config.ps1 @@ -1,11 +1,11 @@ #requires -Version 4 -configuration MSFT_xWebApplication_Present +configuration DSC_WebApplication_Present { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName - { - xWebApplication WebApplication + { + WebApplication WebApplication { Website = $Node.Website Ensure = 'Present' @@ -14,7 +14,7 @@ configuration MSFT_xWebApplication_Present WebAppPool = $Node.ApplicationPool ApplicationType = $Node.ApplicationType AuthenticationInfo = ` - MSFT_xWebApplicationAuthenticationInformation + DSC_WebApplicationAuthenticationInformation { Anonymous = $Node.AuthenticationInfoAnonymous Basic = $Node.AuthenticationInfoBasic @@ -30,13 +30,13 @@ configuration MSFT_xWebApplication_Present } } -configuration MSFT_xWebApplication_Absent +configuration DSC_WebApplication_Absent { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - Node $AllNodes.NodeName - { - xWebApplication WebApplication + Node $AllNodes.NodeName + { + WebApplication WebApplication { Website = $Node.Website Ensure = 'Absent' diff --git a/tests/Integration/MSFT_xWebApplication.config.psd1 b/tests/Integration/DSC_WebApplication.config.psd1 similarity index 100% rename from tests/Integration/MSFT_xWebApplication.config.psd1 rename to tests/Integration/DSC_WebApplication.config.psd1 diff --git a/tests/Integration/MSFT_WebApplicationHandler.Integration.Tests.ps1 b/tests/Integration/DSC_WebApplicationHandler.Integration.Tests.ps1 similarity index 96% rename from tests/Integration/MSFT_WebApplicationHandler.Integration.Tests.ps1 rename to tests/Integration/DSC_WebApplicationHandler.Integration.Tests.ps1 index a20993d7d..debca1d20 100644 --- a/tests/Integration/MSFT_WebApplicationHandler.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WebApplicationHandler.Integration.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_WebApplicationHandler' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebApplicationHandler' try { @@ -35,7 +35,7 @@ try #endregion - Context 'When using MSFT_WebApplicationHandler_AddHandler' { + Context 'When using DSC_WebApplicationHandler_AddHandler' { It 'Should compile and apply the MOF without throwing' { { @@ -79,7 +79,7 @@ try } } - Context 'When using MSFT_WebApplicationHandler_RemoveHandler' { + Context 'When using DSC_WebApplicationHandler_RemoveHandler' { It 'Should compile and apply the MOF without throwing' { { $configurationParameters = @{ @@ -133,7 +133,7 @@ try #endregion - Context 'When using MSFT_WebApplicationHandler_AddHandlerExcludedOptionalParameters' { + Context 'When using DSC_WebApplicationHandler_AddHandlerExcludedOptionalParameters' { It 'Should compile and apply the MOF without throwing when some optional parameters are excluded' { { $configurationParameters = @{ @@ -171,7 +171,7 @@ try } } - Context 'When using MSFT_WebApplicationHandler_RemoveHandlerExcludedOptionalParameters' { + Context 'When using DSC_WebApplicationHandler_RemoveHandlerExcludedOptionalParameters' { It 'Should compile and apply the MOF without throwing' { { $configurationParameters = @{ diff --git a/tests/Integration/MSFT_WebApplicationHandler.config.ps1 b/tests/Integration/DSC_WebApplicationHandler.config.ps1 similarity index 92% rename from tests/Integration/MSFT_WebApplicationHandler.config.ps1 rename to tests/Integration/DSC_WebApplicationHandler.config.ps1 index 9fcdf45cc..b0a1a0894 100644 --- a/tests/Integration/MSFT_WebApplicationHandler.config.ps1 +++ b/tests/Integration/DSC_WebApplicationHandler.config.ps1 @@ -21,9 +21,9 @@ $ConfigurationData = @{ ) } -Configuration MSFT_WebApplicationHandler_AddHandler +Configuration DSC_WebApplicationHandler_AddHandler { - Import-DSCResource -ModuleName xWebAdministration + Import-DSCResource -ModuleName WebAdministrationDsc Node 'localhost' { @@ -47,10 +47,10 @@ Configuration MSFT_WebApplicationHandler_AddHandler } } -Configuration MSFT_WebApplicationHandler_RemoveHandler +Configuration DSC_WebApplicationHandler_RemoveHandler { Import-DSCResource -ModuleName PSDesiredStateConfiguration - Import-DSCResource -ModuleName xWebAdministration + Import-DSCResource -ModuleName WebAdministrationDsc Node 'localhost' { @@ -92,9 +92,9 @@ $ConfigurationDataExcludedOptionalParameters = @{ ) } -Configuration MSFT_WebApplicationHandler_AddHandlerExcludedOptionalParameters +Configuration DSC_WebApplicationHandler_AddHandlerExcludedOptionalParameters { - Import-DSCResource -ModuleName xWebAdministration + Import-DSCResource -ModuleName WebAdministrationDsc Node 'localhost' { @@ -113,9 +113,9 @@ Configuration MSFT_WebApplicationHandler_AddHandlerExcludedOptionalParameters } } -Configuration MSFT_WebApplicationHandler_RemoveHandlerExcludedOptionalParameters +Configuration DSC_WebApplicationHandler_RemoveHandlerExcludedOptionalParameters { - Import-DSCResource -ModuleName xWebAdministration + Import-DSCResource -ModuleName WebAdministrationDsc Node 'localhost' { diff --git a/tests/Integration/MSFT_xWebConfigProperty.Integration.Tests.ps1 b/tests/Integration/DSC_WebConfigProperty.Integration.Tests.ps1 similarity index 98% rename from tests/Integration/MSFT_xWebConfigProperty.Integration.Tests.ps1 rename to tests/Integration/DSC_WebConfigProperty.Integration.Tests.ps1 index ca990cf14..d95196e08 100644 --- a/tests/Integration/MSFT_xWebConfigProperty.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WebConfigProperty.Integration.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = "MSFT_xWebConfigProperty" +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = "DSC_WebConfigProperty" try { diff --git a/tests/Integration/MSFT_xWebConfigProperty.config.ps1 b/tests/Integration/DSC_WebConfigProperty.config.ps1 similarity index 64% rename from tests/Integration/MSFT_xWebConfigProperty.config.ps1 rename to tests/Integration/DSC_WebConfigProperty.config.ps1 index d8b5e2500..693dcc700 100644 --- a/tests/Integration/MSFT_xWebConfigProperty.config.ps1 +++ b/tests/Integration/DSC_WebConfigProperty.config.ps1 @@ -1,10 +1,10 @@ -Configuration MSFT_xWebConfigProperty_Add +Configuration DSC_WebConfigProperty_Add { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node localhost { - xWebConfigProperty IntegrationTest + WebConfigProperty IntegrationTest { WebsitePath = $Node.WebsitePath Filter = $Node.Filter @@ -15,13 +15,13 @@ Configuration MSFT_xWebConfigProperty_Add } } -Configuration MSFT_xWebConfigProperty_Update +Configuration DSC_WebConfigProperty_Update { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node localhost { - xWebConfigProperty IntegrationTest + WebConfigProperty IntegrationTest { WebsitePath = $Node.WebsitePath Filter = $Node.Filter @@ -32,13 +32,13 @@ Configuration MSFT_xWebConfigProperty_Update } } -Configuration MSFT_xWebConfigProperty_Integer +Configuration DSC_WebConfigProperty_Integer { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node localhost { - xWebConfigProperty IntegrationTest + WebConfigProperty IntegrationTest { WebsitePath = $Node.WebsitePath Filter = $Node.IntegerFilter @@ -49,13 +49,13 @@ Configuration MSFT_xWebConfigProperty_Integer } } -Configuration MSFT_xWebConfigProperty_Remove +Configuration DSC_WebConfigProperty_Remove { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node localhost { - xWebConfigProperty IntegrationTest + WebConfigProperty IntegrationTest { WebsitePath = $Node.WebsitePath Filter = $Node.Filter diff --git a/tests/Integration/MSFT_xWebConfigPropertyCollection.Integration.Tests.ps1 b/tests/Integration/DSC_WebConfigPropertyCollection.Integration.Tests.ps1 similarity index 98% rename from tests/Integration/MSFT_xWebConfigPropertyCollection.Integration.Tests.ps1 rename to tests/Integration/DSC_WebConfigPropertyCollection.Integration.Tests.ps1 index a3addf856..d5a3dd3bf 100644 --- a/tests/Integration/MSFT_xWebConfigPropertyCollection.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WebConfigPropertyCollection.Integration.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = "MSFT_xWebConfigPropertyCollection" +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = "DSC_WebConfigPropertyCollection" try { diff --git a/tests/Integration/MSFT_xWebConfigPropertyCollection.config.ps1 b/tests/Integration/DSC_WebConfigPropertyCollection.config.ps1 similarity index 75% rename from tests/Integration/MSFT_xWebConfigPropertyCollection.config.ps1 rename to tests/Integration/DSC_WebConfigPropertyCollection.config.ps1 index b960beb87..8b02a7170 100644 --- a/tests/Integration/MSFT_xWebConfigPropertyCollection.config.ps1 +++ b/tests/Integration/DSC_WebConfigPropertyCollection.config.ps1 @@ -1,11 +1,11 @@ -Configuration MSFT_xWebConfigPropertyCollection_Add +Configuration DSC_WebConfigPropertyCollection_Add { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node localhost { - xWebConfigPropertyCollection IntegrationTest + WebConfigPropertyCollection IntegrationTest { WebsitePath = $Node.WebsitePath Filter = $Node.Filter @@ -20,13 +20,13 @@ Configuration MSFT_xWebConfigPropertyCollection_Add } } -Configuration MSFT_xWebConfigPropertyCollection_Update +Configuration DSC_WebConfigPropertyCollection_Update { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node localhost { - xWebConfigPropertyCollection IntegrationTest + WebConfigPropertyCollection IntegrationTest { WebsitePath = $Node.WebsitePath Filter = $Node.Filter @@ -41,13 +41,13 @@ Configuration MSFT_xWebConfigPropertyCollection_Update } } -Configuration MSFT_xWebConfigPropertyCollection_Remove +Configuration DSC_WebConfigPropertyCollection_Remove { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node localhost { - xWebConfigPropertyCollection IntegrationTest + WebConfigPropertyCollection IntegrationTest { WebsitePath = $Node.WebsitePath Filter = $Node.Filter @@ -61,13 +61,13 @@ Configuration MSFT_xWebConfigPropertyCollection_Remove } } -Configuration MSFT_xWebConfigPropertyCollection_Integer +Configuration DSC_WebConfigPropertyCollection_Integer { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc node localhost { - xWebConfigPropertyCollection IntegrationTest + WebConfigPropertyCollection IntegrationTest { WebsitePath = $Node.WebsitePath Filter = $Node.IntegerFilter diff --git a/tests/Integration/MSFT_xWebSite.Integration.Tests.ps1 b/tests/Integration/DSC_WebSite.Integration.Tests.ps1 similarity index 72% rename from tests/Integration/MSFT_xWebSite.Integration.Tests.ps1 rename to tests/Integration/DSC_WebSite.Integration.Tests.ps1 index e65c25986..450c97015 100644 --- a/tests/Integration/MSFT_xWebSite.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WebSite.Integration.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebSite' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebSite' try { @@ -22,7 +22,7 @@ $tempName = "$($script:dscResourceName)_" + (Get-Date).ToString('yyyyMMdd_HHmmss try { - # Now that xWebAdministration should be discoverable, load the configuration data + # Now that WebAdministrationDsc should be discoverable, load the configuration data $configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" . $configFile @@ -59,11 +59,27 @@ try Describe "$($script:dscResourceName)_Webconfig_Get_Test_Set" { #region DEFAULT TESTS - It 'Should compile without throwing' { + It 'Should compile the MOF without throwing' { { - Invoke-Expression -Command "$($script:dscResourceName)_Webconfig_Get_Test_Set -ConfigurationData `$dscConfig -OutputPath `$TestDrive -CertificateThumbprint `$selfSignedCert.Thumbprint" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + & "$($script:DSCResourceName)_Webconfig_Get_Test_Set" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig ` + -CertificateThumbprint $selfSignedCert.Thumbprint + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { + { + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw } It 'Should be able to call Get-DscConfiguration without throwing' { @@ -78,11 +94,27 @@ try Describe "$($script:dscResourceName)_Present_Started" { #region DEFAULT TESTS - It 'Should compile without throwing' { + It 'Should compile the MOF without throwing' { + { + & "$($script:DSCResourceName)_Present_Started" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig ` + -CertificateThumbprint $selfSignedCert.Thumbprint + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { { - Invoke-Expression -Command "$($script:dscResourceName)_Present_Started -ConfigurationData `$dscConfig -OutputPath `$TestDrive -CertificateThumbprint `$selfSignedCert.Thumbprint" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw } It 'Should be able to call Get-DscConfiguration without throwing' { @@ -92,7 +124,21 @@ try It 'Should Create a Started Website with correct settings' -test { - Invoke-Expression -Command "$($script:dscResourceName)_Present_Started -ConfigurationData `$dscConfig -OutputPath `$TestDrive -CertificateThumbprint `$selfSignedCert.Thumbprint" + & "$($script:dscResourceName)_Present_Started" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig ` + -CertificateThumbprint $selfSignedCert.Thumbprint` + -Verbose + + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop # Build results to test $result = Get-Website -Name $dscConfig.AllNodes.Website @@ -166,11 +212,27 @@ try Describe "$($script:dscResourceName)_Logging_Configured" { #region DEFAULT TESTS - It 'Should compile without throwing' { + It 'Should compile the MOF without throwing' { + { + & "$($script:DSCResourceName)_Logging_Configured" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig ` + -CertificateThumbprint $selfSignedCert.Thumbprint + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { { - Invoke-Expression -Command "$($script:dscResourceName)_Logging_Configured -ConfigurationData `$dscConfig -OutputPath `$TestDrive -CertificateThumbprint `$selfSignedCert.Thumbprint" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw } It 'Should be able to call Get-DscConfiguration without throwing' { @@ -180,7 +242,20 @@ try It 'Should update the enabled LogFlags' -test { - Invoke-Expression -Command "$($script:dscResourceName)_Logging_Configured -ConfigurationData `$dscConfig -OutputPath `$TestDrive -CertificateThumbprint `$selfSignedCert.Thumbprint" + & "$($script:DSCResourceName)_Logging_Configured" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig ` + -CertificateThumbprint $selfSignedCert.Thumbprint + + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop # Build results to test $result = Get-Website -Name $dscConfig.AllNodes.Website @@ -193,11 +268,27 @@ try Describe "$($script:dscResourceName)_Present_Stopped" { #region DEFAULT TESTS - It 'Should compile without throwing' { + It 'Should compile the MOF without throwing' { + { + & "$($script:DSCResourceName)_Present_Stopped" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig ` + -CertificateThumbprint $selfSignedCert.Thumbprint + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { { - Invoke-Expression -Command "$($script:dscResourceName)_Present_Stopped -ConfigurationData `$dscConfig -OutputPath `$TestDrive -CertificateThumbprint `$selfSignedCert.Thumbprint" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw } It 'Should be able to call Get-DscConfiguration without throwing' { @@ -207,7 +298,20 @@ try It 'Should Create a Stopped Website with correct settings' -test { - Invoke-Expression -Command "$($script:dscResourceName)_Present_Stopped -ConfigurationData `$dscConfig -OutputPath `$TestDrive -CertificateThumbprint `$selfSignedCert.Thumbprint" + & "$($script:DSCResourceName)_Present_Stopped" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig ` + -CertificateThumbprint $selfSignedCert.Thumbprint + + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop # Build results to test $result = Get-Website -Name $dscConfig.AllNodes.Website @@ -274,11 +378,26 @@ try Describe "$($script:dscResourceName)_Absent" { #region DEFAULT TESTS - It 'Should compile without throwing' { + It 'Should compile the MOF without throwing' { { - Invoke-Expression -Command "$($script:dscResourceName)_Absent -ConfigurationData `$dscConfig -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + & "$($script:DSCResourceName)_Absent" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { + { + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw } It 'Should be able to call Get-DscConfiguration without throwing' { @@ -288,7 +407,19 @@ try It 'Should remove the Website' -test { - Invoke-Expression -Command "$($script:dscResourceName)_Absent -ConfigurationData `$dscConfig -OutputPath `$TestDrive" + & "$($script:DSCResourceName)_Absent" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig + + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop # Build results to test $result = Get-Website -Name $dscConfig.AllNodes.Website @@ -297,15 +428,14 @@ try $result | Should BeNullOrEmpty } - } - Describe 'MSFT_xWebBindingInformation' { + Describe 'DSC_WebBindingInformation' { # Directly interacting with Cim classes is not supported by PowerShell DSC # it is being done here explicitly for the purpose of testing. Please do not # do this in actual resource code - $storeNames = (Get-CimClass -Namespace 'root/microsoft/Windows/DesiredStateConfiguration' -ClassName 'MSFT_xWebBindingInformation').CimClassProperties['CertificateStoreName'].Qualifiers['Values'].Value + $storeNames = (Get-CimClass -Namespace 'root/microsoft/Windows/DesiredStateConfiguration' -ClassName 'DSC_WebBindingInformation').CimClassProperties['CertificateStoreName'].Qualifiers['Values'].Value foreach ($storeName in $storeNames) { diff --git a/tests/Integration/MSFT_xWebSite.config.ps1 b/tests/Integration/DSC_WebSite.config.ps1 similarity index 87% rename from tests/Integration/MSFT_xWebSite.config.ps1 rename to tests/Integration/DSC_WebSite.config.ps1 index ef37d5335..736ce6135 100644 --- a/tests/Integration/MSFT_xWebSite.config.ps1 +++ b/tests/Integration/DSC_WebSite.config.ps1 @@ -1,6 +1,6 @@ #requires -Version 4 -configuration MSFT_xWebSite_Present_Started +configuration DSC_WebSite_Present_Started { param( @@ -9,11 +9,11 @@ configuration MSFT_xWebSite_Present_Started ) - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xWebSite Website + WebSite Website { Name = $Node.Website SiteId = $Node.SiteId @@ -21,7 +21,7 @@ configuration MSFT_xWebSite_Present_Started ApplicationType = $Node.ApplicationType ApplicationPool = $Node.ApplicationPool AuthenticationInfo = ` - MSFT_xWebAuthenticationInformation + DSC_WebAuthenticationInformation { Anonymous = $Node.AuthenticationInfoAnonymous Basic = $Node.AuthenticationInfoBasic @@ -29,21 +29,21 @@ configuration MSFT_xWebSite_Present_Started Windows = $Node.AuthenticationInfoWindows } BindingInfo = @( - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPProtocol Port = $Node.HTTPPort IPAddress = '*' Hostname = $Node.HTTP1Hostname } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPProtocol Port = $Node.HTTPPort IPAddress = '*' Hostname = $Node.HTTP2Hostname } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPSProtocol Port = $Node.HTTPSPort @@ -53,7 +53,7 @@ configuration MSFT_xWebSite_Present_Started CertificateStoreName = $Node.CertificateStoreName SslFlags = $Node.SslFlags } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPSProtocol Port = $Node.HTTPSPort2 @@ -76,13 +76,13 @@ configuration MSFT_xWebSite_Present_Started LogFormat = $Node.LogFormat LogTargetW3C = 'ETW' LogCustomFields = @( - MSFT_xLogCustomFieldInformation + DSC_LogCustomFieldInformation { LogFieldName = $Node.LogFieldName1 SourceName = $Node.SourceName1 SourceType = $Node.SourceType1 } - MSFT_xLogCustomFieldInformation + DSC_LogCustomFieldInformation { LogFieldName = $Node.LogFieldName2 SourceName = $Node.SourceName2 @@ -93,7 +93,7 @@ configuration MSFT_xWebSite_Present_Started } } -configuration MSFT_xWebSite_Present_Stopped +configuration DSC_WebSite_Present_Stopped { param( @@ -102,18 +102,18 @@ configuration MSFT_xWebSite_Present_Stopped ) - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xWebSite Website + WebSite Website { Name = $Node.Website Ensure = 'Present' ApplicationType = $Node.ApplicationType ApplicationPool = $Node.ApplicationPool AuthenticationInfo = ` - MSFT_xWebAuthenticationInformation + DSC_WebAuthenticationInformation { Anonymous = $Node.AuthenticationInfoAnonymous Basic = $Node.AuthenticationInfoBasic @@ -121,21 +121,21 @@ configuration MSFT_xWebSite_Present_Stopped Windows = $Node.AuthenticationInfoWindows } BindingInfo = @( - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPProtocol Port = $Node.HTTPPort IPAddress = '*' Hostname = $Node.HTTP1Hostname } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPProtocol Port = $Node.HTTPPort IPAddress = '*' Hostname = $Node.HTTP2Hostname } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPSProtocol Port = $Node.HTTPSPort @@ -145,7 +145,7 @@ configuration MSFT_xWebSite_Present_Stopped CertificateStoreName = $Node.CertificateStoreName SslFlags = $Node.SslFlags } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPSProtocol Port = $Node.HTTPSPort2 @@ -165,13 +165,13 @@ configuration MSFT_xWebSite_Present_Stopped State = 'Stopped' ServerAutoStart = $false LogCustomFields = @( - MSFT_xLogCustomFieldInformation + DSC_LogCustomFieldInformation { LogFieldName = $Node.LogFieldName1 SourceName = $Node.SourceName1 SourceType = $Node.SourceType1 } - MSFT_xLogCustomFieldInformation + DSC_LogCustomFieldInformation { LogFieldName = $Node.LogFieldName2 SourceName = $Node.SourceName2 @@ -182,13 +182,13 @@ configuration MSFT_xWebSite_Present_Stopped } } -configuration MSFT_xWebSite_Absent +configuration DSC_WebSite_Absent { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xWebSite Website + WebSite Website { Name = $Node.Website Ensure = 'Absent' @@ -196,7 +196,7 @@ configuration MSFT_xWebSite_Absent } } -configuration MSFT_xWebSite_Webconfig_Get_Test_Set +configuration DSC_WebSite_Webconfig_Get_Test_Set { param( @@ -206,7 +206,7 @@ configuration MSFT_xWebSite_Webconfig_Get_Test_Set ) Import-DscResource -ModuleName PSDesiredStateConfiguration - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { @@ -232,7 +232,7 @@ configuration MSFT_xWebSite_Webconfig_Get_Test_Set ' } - xWebSite Website + WebSite Website { DependsOn = '[File]WebConfig' Name = $Node.Website @@ -240,7 +240,7 @@ configuration MSFT_xWebSite_Webconfig_Get_Test_Set ApplicationType = $Node.ApplicationType ApplicationPool = $Node.ApplicationPool AuthenticationInfo = ` - MSFT_xWebAuthenticationInformation + DSC_WebAuthenticationInformation { Anonymous = $Node.AuthenticationInfoAnonymous Basic = $Node.AuthenticationInfoBasic @@ -248,21 +248,21 @@ configuration MSFT_xWebSite_Webconfig_Get_Test_Set Windows = $Node.AuthenticationInfoWindows } BindingInfo = @( - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPProtocol Port = $Node.HTTPPort IPAddress = '*' Hostname = $Node.HTTP1Hostname } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPProtocol Port = $Node.HTTPPort IPAddress = '*' Hostname = $Node.HTTP2Hostname } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPSProtocol Port = $Node.HTTPSPort @@ -272,7 +272,7 @@ configuration MSFT_xWebSite_Webconfig_Get_Test_Set CertificateStoreName = $Node.CertificateStoreName SslFlags = $Node.SslFlags } - MSFT_xWebBindingInformation + DSC_WebBindingInformation { Protocol = $Node.HTTPSProtocol Port = $Node.HTTPSPort2 @@ -293,13 +293,13 @@ configuration MSFT_xWebSite_Webconfig_Get_Test_Set LogFlags = $Node.LogFlags1 LogFormat = $Node.LogFormat LogCustomFields = @( - MSFT_xLogCustomFieldInformation + DSC_LogCustomFieldInformation { LogFieldName = $Node.LogFieldName1 SourceName = $Node.SourceName1 SourceType = $Node.SourceType1 } - MSFT_xLogCustomFieldInformation + DSC_LogCustomFieldInformation { LogFieldName = $Node.LogFieldName2 SourceName = $Node.SourceName2 @@ -310,7 +310,7 @@ configuration MSFT_xWebSite_Webconfig_Get_Test_Set } } -configuration MSFT_xWebSite_Logging_Configured +configuration DSC_WebSite_Logging_Configured { param( @@ -319,15 +319,15 @@ configuration MSFT_xWebSite_Logging_Configured ) - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xWebSite Website + WebSite Website { Name = $Node.Website LogFlags = $Node.LogFlags2 LogFormat = $Node.LogFormat } } -} \ No newline at end of file +} diff --git a/tests/Integration/MSFT_xWebSite.config.psd1 b/tests/Integration/DSC_WebSite.config.psd1 similarity index 100% rename from tests/Integration/MSFT_xWebSite.config.psd1 rename to tests/Integration/DSC_WebSite.config.psd1 diff --git a/tests/Integration/MSFT_xWebSiteDefaults.Integration.Tests.ps1 b/tests/Integration/DSC_WebSiteDefaults.Integration.Tests.ps1 similarity index 96% rename from tests/Integration/MSFT_xWebSiteDefaults.Integration.Tests.ps1 rename to tests/Integration/DSC_WebSiteDefaults.Integration.Tests.ps1 index f107e247d..916e98179 100644 --- a/tests/Integration/MSFT_xWebSiteDefaults.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WebSiteDefaults.Integration.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebSiteDefaults' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebSiteDefaults' try { diff --git a/tests/Integration/MSFT_xWebSiteDefaults.config.ps1 b/tests/Integration/DSC_WebSiteDefaults.config.ps1 similarity index 76% rename from tests/Integration/MSFT_xWebSiteDefaults.config.ps1 rename to tests/Integration/DSC_WebSiteDefaults.config.ps1 index efb18d2e0..bc8c90ce8 100644 --- a/tests/Integration/MSFT_xWebSiteDefaults.config.ps1 +++ b/tests/Integration/DSC_WebSiteDefaults.config.ps1 @@ -12,11 +12,11 @@ else $env:PesterVirtualDirectoryDefaults = "true" } -configuration MSFT_xWebSiteDefaults_Config +configuration DSC_WebSiteDefaults_Config { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - xWebSiteDefaults virtualDirectoryDefaults + WebSiteDefaults virtualDirectoryDefaults { IsSingleInstance = 'Yes' AllowSubDirConfig = "$env:PesterVirtualDirectoryDefaults" diff --git a/tests/Integration/MSFT_xWebVirtualDirectory.Integration.Tests.ps1 b/tests/Integration/DSC_WebVirtualDirectory.Integration.Tests.ps1 similarity index 57% rename from tests/Integration/MSFT_xWebVirtualDirectory.Integration.Tests.ps1 rename to tests/Integration/DSC_WebVirtualDirectory.Integration.Tests.ps1 index bc5f57d2f..fd1f43dc0 100644 --- a/tests/Integration/MSFT_xWebVirtualDirectory.Integration.Tests.ps1 +++ b/tests/Integration/DSC_WebVirtualDirectory.Integration.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebVirtualDirectory' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebVirtualDirectory' try { @@ -24,11 +24,11 @@ try { $null = Backup-WebConfiguration -Name $tempName - # Now that xWebAdministration should be discoverable load the configuration data + # Now that WebAdministrationDsc should be discoverable load the configuration data $ConfigFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" . $ConfigFile - $DSCConfig = Import-LocalizedData -BaseDirectory $PSScriptRoot -FileName "$($script:dscResourceName).config.psd1" + $dscConfig = Import-LocalizedData -BaseDirectory $PSScriptRoot -FileName "$($script:dscResourceName).config.psd1" Describe "$($script:dscResourceName)_Initialize" { Invoke-Expression -Command "$($script:dscResourceName)_Initialize -ConfigurationData `$DSCConfig -OutputPath `$TestDrive" @@ -37,20 +37,47 @@ try Describe "$($script:dscResourceName)_Present" { #region DEFAULT TESTS - It 'Should compile without throwing' { + It 'Should compile the MOF without throwing' { { - Invoke-Expression -Command "$($script:dscResourceName)_Present -ConfigurationData `$DSCConfig -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + & "$($script:DSCResourceName)_Present" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig ` + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { + { + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw } It 'Should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw + { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw } #endregion It 'Should create a WebVirtualDirectory with correct settings' -Test { - Invoke-Expression -Command "$($script:dscResourceName)_Present -ConfigurationData `$DSCConfig -OutputPath `$TestDrive" + & "$($script:DSCResourceName)_Present" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig + + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop # Build results to test $result = Get-WebVirtualDirectory -Site $DSCConfig.AllNodes.Website ` @@ -65,20 +92,47 @@ try Describe "$($script:dscResourceName)_Absent" { #region DEFAULT TESTS - It 'Should compile without throwing' { + It 'Should compile the MOF without throwing' { + { + & "$($script:DSCResourceName)_Absent" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig + } | Should -Not -Throw + } + + It 'Should apply the MOF without throwing' { { - Invoke-Expression -Command "$($script:dscResourceName)_Absent -ConfigurationData `$DSCConfig -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop + } | Should -Not -Throw } It 'Should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw + { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -Throw } #endregion It 'Should remove the WebVirtualDirectory' -Test { - Invoke-Expression -Command "$($script:dscResourceName)_Absent -ConfigurationData `$DSCConfg -OutputPath `$TestDrive" + & "$($script:DSCResourceName)_Absent" ` + -OutputPath $TestDrive ` + -ConfigurationData $dscConfig + + Reset-DscLcm + + Start-DscConfiguration ` + -Path $TestDrive ` + -ComputerName localhost ` + -Wait ` + -Verbose ` + -Force ` + -ErrorAction Stop # Build results to test $result = Get-WebVirtualDirectory -Site $DSCConfig.AllNodes.Website ` diff --git a/tests/Integration/MSFT_xWebVirtualDirectory.config.ps1 b/tests/Integration/DSC_WebVirtualDirectory.config.ps1 similarity index 71% rename from tests/Integration/MSFT_xWebVirtualDirectory.config.ps1 rename to tests/Integration/DSC_WebVirtualDirectory.config.ps1 index 605d854dd..d7ca3153b 100644 --- a/tests/Integration/MSFT_xWebVirtualDirectory.config.ps1 +++ b/tests/Integration/DSC_WebVirtualDirectory.config.ps1 @@ -1,17 +1,17 @@ #requires -Version 4 -configuration MSFT_xWebVirtualDirectory_Initialize +configuration DSC_WebVirtualDirectory_Initialize { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xWebSite Website + WebSite Website { Ensure = 'Present' Name = $Node.Website PhysicalPath = $Node.WebsitePhysicalPath ApplicationPool = $Node.ApplicationPool - BindingInfo = MSFT_xWebBindingInformation + BindingInfo = DSC_WebBindingInformation { Protocol = 'http' Port = $Node.Port @@ -27,13 +27,13 @@ configuration MSFT_xWebVirtualDirectory_Initialize Type = 'Directory' } - xWebApplication WebApplication + WebApplication WebApplication { Name = $Node.WebApplication Website = $Node.Website WebAppPool = $Node.ApplicationPool PhysicalPath = $Node.WebApplicationPhysicalPath - DependsOn = '[File]WebApplicationDirectory','[xWebSite]Website' + DependsOn = '[File]WebApplicationDirectory','[WebSite]Website' } File WebVirtualDirectory @@ -45,13 +45,13 @@ configuration MSFT_xWebVirtualDirectory_Initialize } } -configuration MSFT_xWebVirtualDirectory_Present +configuration DSC_WebVirtualDirectory_Present { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { - xWebVirtualDirectory WebVirtualDirectory + WebVirtualDirectory WebVirtualDirectory { Ensure = 'Present' Website = $Node.Website @@ -62,13 +62,13 @@ configuration MSFT_xWebVirtualDirectory_Present } } -configuration MSFT_xWebVirtualDirectory_Absent +configuration DSC_WebVirtualDirectory_Absent { - Import-DscResource -ModuleName xWebAdministration + Import-DscResource -ModuleName WebAdministrationDsc - Node $AllNodes.NodeName + Node $AllNodes.NodeName { - xWebVirtualDirectory WebVirtualDirectory + WebVirtualDirectory WebVirtualDirectory { Ensure = 'Absent' Website = $Node.Website diff --git a/tests/Integration/MSFT_xWebVirtualDirectory.config.psd1 b/tests/Integration/DSC_WebVirtualDirectory.config.psd1 similarity index 100% rename from tests/Integration/MSFT_xWebVirtualDirectory.config.psd1 rename to tests/Integration/DSC_WebVirtualDirectory.config.psd1 diff --git a/tests/Integration/MSFT_xIISFeatureDelegation.config.ps1 b/tests/Integration/MSFT_xIISFeatureDelegation.config.ps1 deleted file mode 100644 index 8b7b5eefa..000000000 --- a/tests/Integration/MSFT_xIISFeatureDelegation.config.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -configuration MSFT_xIISFeatureDelegation_AllowDelegation -{ - Import-DscResource -ModuleName xWebAdministration - - xIisFeatureDelegation AllowDelegation - { - Path = 'MACHINE/WEBROOT/APPHOST' - Filter = '/system.web/customErrors' - OverrideMode = 'Allow' - } -} - -configuration MSFT_xIISFeatureDelegation_DenyDelegation -{ - Import-DscResource -ModuleName xWebAdministration - - xIisFeatureDelegation DenyDelegation - { - Path = 'MACHINE/WEBROOT/APPHOST' - Filter = '/system.webServer/defaultDocument' - OverrideMode = 'Deny' - } -} diff --git a/tests/Integration/MSFT_xIISHandler.Integration.Tests.ps1 b/tests/Integration/MSFT_xIISHandler.Integration.Tests.ps1 deleted file mode 100644 index dc98ad452..000000000 --- a/tests/Integration/MSFT_xIISHandler.Integration.Tests.ps1 +++ /dev/null @@ -1,80 +0,0 @@ - -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xIISHandler' - -try -{ - Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' -} -catch [System.IO.FileNotFoundException] -{ - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.' -} - -$script:testEnvironment = Initialize-TestEnvironment ` - -DSCModuleName $script:dscModuleName ` - -DSCResourceName $script:dscResourceName ` - -ResourceType 'Mof' ` - -TestType 'Integration' - -Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') -Force - -$tempName = "$($script:dscResourceName)_" + (Get-Date).ToString("yyyyMMdd_HHmmss") - -try -{ - $ConfigFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" - . $ConfigFile - - $null = Backup-WebConfiguration -Name $tempName - - Describe "$($script:dscResourceName)_Integration" { - #region DEFAULT TESTS - It 'Should compile without throwing' { - { - Invoke-Expression -Command "$($script:dscResourceName)_RemoveHandler -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw - } - - It 'should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw - } - #endregion - - It 'Add a handler' { - # webDav is normally not there, and even if the WebDav feature is not installed - # we can add a handler for it. - - { - # TRACEVerbHandler is usually there, remove it - - Invoke-Expression -Command "$($script:dscResourceName)_AddHandler -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | should not throw - - [string]$filter = "system.webServer/handlers/Add[@Name='WebDAV']" - ((Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter $filter -Name .) | Measure-Object).Count | should be 1 - } - - It 'StaticFile handler' { - # StaticFile is usually there, have it present shouldn't change anything. - { - Invoke-Expression -Command "$($script:dscResourceName)_StaticFileHandler -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | should not throw - - [string]$filter = "system.webServer/handlers/Add[@Name='StaticFile']" - ((Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter $filter -Name .) | Measure-Object).Count | should be 1 - } - } - #endregion -} -finally -{ - Restore-WebConfigurationWrapper -Name $tempName -Verbose - - Remove-WebConfigurationBackup -Name $tempName -Verbose - - Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose -} diff --git a/tests/Integration/MSFT_xIISHandler.config.ps1 b/tests/Integration/MSFT_xIISHandler.config.ps1 deleted file mode 100644 index dc00104ec..000000000 --- a/tests/Integration/MSFT_xIISHandler.config.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -configuration MSFT_xIISHandler_RemoveHandler -{ - Import-DscResource -ModuleName xWebAdministration - - xIisHandler TRACEVerbHandler - { - Name = 'TRACEVerbHandler' - Ensure = 'Absent' - } -} - -configuration MSFT_xIISHandler_AddHandler -{ - Import-DscResource -ModuleName xWebAdministration - - xIisHandler WebDAV - { - Name = 'WebDAV' - Ensure = 'Present' - } -} - -configuration MSFT_xIISHandler_StaticFileHandler -{ - Import-DscResource -ModuleName xWebAdministration - - xIisHandler StaticFile - { - Name = 'StaticFile' - Ensure = 'Present' - } -} diff --git a/tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1 b/tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1 deleted file mode 100644 index fbc34602e..000000000 --- a/tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1 +++ /dev/null @@ -1,155 +0,0 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebApplication' - -try -{ - Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' -} -catch [System.IO.FileNotFoundException] -{ - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.' -} - -$script:testEnvironment = Initialize-TestEnvironment ` - -DSCModuleName $script:dscModuleName ` - -DSCResourceName $script:dscResourceName ` - -ResourceType 'Mof' ` - -TestType 'Integration' - -Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') -Force - -$tempName = "$($script:dscResourceName)_" + (Get-Date).ToString('yyyyMMdd_HHmmss') - -try -{ - $null = Backup-WebConfiguration -Name $tempName - - # Now that xWebAdministration should be discoverable load the configuration data - $ConfigFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" - . $ConfigFile - - $DSCConfig = Import-LocalizedData -BaseDirectory $PSScriptRoot -FileName "$($script:dscResourceName).config.psd1" - - #region HelperFunctions - - # Function needed to test AuthenticationInfo - function Get-AuthenticationInfo ($Type, $Website, $WebApplication) - { - (Get-WebConfigurationProperty ` - -Filter /system.WebServer/security/authentication/${Type}Authentication ` - -Name enabled ` - -Location "${Website}/${WebApplication}").Value - } - - # Function needed to test SslFlags - function Get-SslFlags ($Website, $WebApplication) - { - Get-WebConfiguration ` - -PSPath IIS:\Sites ` - -Location "${Website}/${WebApplication}" ` - -Filter 'system.webserver/security/access' | ` - ForEach-Object { $_.sslFlags } - } - - #endregion - - # Create a new website for the WebApplication - - New-Website -Name $DSCConfig.AllNodes.Website ` - -Id 100 ` - -PhysicalPath $DSCConfig.AllNodes.PhysicalPath ` - -ApplicationPool $DSCConfig.AllNodes.AppPool ` - -SslFlags $DSCConfig.AllNodes.SslFlags ` - -Port $DSCConfig.AllNodes.HTTPSPort ` - -IPAddress '*' ` - -HostHeader $DSCConfig.AllNodes.HTTPSHostname ` - -Ssl ` - -Force ` - -ErrorAction Stop - - Describe "$($script:dscResourceName)_Present" { - #region DEFAULT TESTS - It 'Should compile without throwing' { - { - Invoke-Expression -Command "$($script:dscResourceName)_Present -ConfigurationData `$DSCConfig -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw - } - - It 'should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw - } - #endregion - - It 'Should create a WebApplication with correct settings' -test { - - Invoke-Expression -Command "$($script:dscResourceName)_Present -ConfigurationData `$DSCConfg -OutputPath `$TestDrive" - - # Build results to test - $Result = Get-WebApplication -Site $DSCConfig.AllNodes.Website -Name $DSCConfig.AllNodes.WebApplication - $ServiceAutoStartProviders = (Get-WebConfiguration -filter /system.applicationHost/serviceAutoStartProviders).Collection - - # Test WebApplication basic settings are correct - $Result.Path | Should Match $DSCConfig.AllNodes.WebApplication - $Result.PhysicalPath | Should Be $DSCConfig.AllNodes.PhysicalPath - $Result.ApplicationPool | Should Be $DSCConfig.AllNodes.ApplicationPool - - # Test Website AuthenticationInfo are correct - Get-AuthenticationInfo -Type 'Anonymous' -Website $DSCConfig.AllNodes.Website -WebApplication $DSCConfig.AllNodes.WebApplication | Should Be $DSCConfig.AllNodes.AuthenticationInfoAnonymous - Get-AuthenticationInfo -Type 'Basic' -Website $DSCConfig.AllNodes.Website -WebApplication $DSCConfig.AllNodes.WebApplication | Should Be $DSCConfig.AllNodes.AuthenticationInfoBasic - Get-AuthenticationInfo -Type 'Digest' -Website $DSCConfig.AllNodes.Website -WebApplication $DSCConfig.AllNodes.WebApplication | Should Be $DSCConfig.AllNodes.AuthenticationInfoDigest - Get-AuthenticationInfo -Type 'Windows' -Website $DSCConfig.AllNodes.Website -WebApplication $DSCConfig.AllNodes.WebApplication | Should Be $DSCConfig.AllNodes.AuthenticationInfoWindows - - # Test WebApplication settings - $Result.PreloadEnabled | Should Be $DSCConfig.AllNodes.PreloadEnabled - $Result.ServiceAutoStartProvider | Should Be $DSCConfig.AllNodes.ServiceAutoStartProvider - $Result.ServiceAutoStartEnabled | Should Be $DSCConfig.AllNodes.ServiceAutoStartEnabled - - # Test the serviceAutoStartProviders are present in IIS config - $ServiceAutoStartProviders.Name | Should Be $DSCConfig.AllNodes.ServiceAutoStartProvider - $ServiceAutoStartProviders.Type | Should Be $DSCConfig.AllNodes.ApplicationType - - # Test WebApplication SslFlags - Get-SslFlags -Website $DSCConfig.AllNodes.Website -WebApplication $DSCConfig.AllNodes.WebApplication | Should Be $DSCConfig.AllNodes.WebApplicationSslFlags - - # Test EnabledProtocols - $Result.EnabledProtocols | Should Be ($DSCConfig.AllNodes.EnabledProtocols -join ',') - - } - - } - - Describe "$($script:dscResourceName)_Absent" { - #region DEFAULT TESTS - It 'Should compile without throwing' { - { - Invoke-Expression -Command "$($script:dscResourceName)_Absent -ConfigurationData `$DSCConfig -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should not throw - } - - It 'should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw - } - #endregion - - It 'Should remove the WebApplication' -test { - Invoke-Expression -Command "$($script:dscResourceName)_Absent -ConfigurationData `$DSCConfg -OutputPath `$TestDrive" - - # Build results to test - $Result = Get-WebApplication -Site $DSCConfig.AllNodes.Website -Name $DSCConfig.AllNodes.WebApplication - - # Test WebApplication is removed - $Result | Should BeNullOrEmpty - } - - } -} -finally -{ - Restore-WebConfigurationWrapper -Name $tempName -Verbose - - Remove-WebConfigurationBackup -Name $tempName -Verbose - - Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose -} diff --git a/tests/Integration/MSFT_xWebConfigKeyValue.Integration.Tests.ps1 b/tests/Integration/MSFT_xWebConfigKeyValue.Integration.Tests.ps1 deleted file mode 100644 index bb4b2b441..000000000 --- a/tests/Integration/MSFT_xWebConfigKeyValue.Integration.Tests.ps1 +++ /dev/null @@ -1,97 +0,0 @@ - -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebConfigKeyValue' - -try -{ - Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' -} -catch [System.IO.FileNotFoundException] -{ - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.' -} - -$script:testEnvironment = Initialize-TestEnvironment ` - -DSCModuleName $script:dscModuleName ` - -DSCResourceName $script:dscResourceName ` - -ResourceType 'Mof' ` - -TestType 'Integration' - -Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') -Force - -$tempName = "$($script:dscResourceName)_" + (Get-Date).ToString("yyyyMMdd_HHmmss") - -try -{ - #region Integration Tests - $configFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dscResourceName).config.ps1" - . $configFile - - $null = Backup-WebConfiguration -Name $tempName - - # Constants for Tests - $env:xWebConfigKeyValuePsPath = 'IIS:\Sites\Default Web Site' - $env:xWebConfigKeyValueIntegrationKey = 'xWebAdministration Integration Tests Key' - - Describe "$($script:dscResourceName)_Integration" { - #region DEFAULT TESTS - It 'Should compile and apply the MOF without throwing' { - { - & "$($script:dscResourceName)_Config" -OutputPath $TestDrive - Start-DscConfiguration -Path $TestDrive ` - -ComputerName localhost -Wait -Verbose -Force - } | Should not throw - } - - It 'Should be able to call Get-DscConfiguration without throwing' { - { Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw - } - #endregion - - It 'Should update AppSetting "xWebAdministration Integration Tests Key"' { - { - # Get the current value - [string] $originalValue = (Get-WebConfigurationProperty ` - -PSPath $env:xWebConfigKeyValuePsPath ` - -Filter "appSettings/add[@key='$($env:xWebConfigKeyValueIntegrationKey)']" ` - -Name 'value').Value - - $env:xWebConfigKeyValueIntegrationValueUpdated = $originalValue + "-updated" - - Invoke-Expression -Command "$($script:dscResourceName)_AppSetting_Update -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should Not throw - - # Compare the updated value - [string] $changedValue = (Get-WebConfigurationProperty ` - -PSPath $env:xWebConfigKeyValuePsPath ` - -Filter "appSettings/add[@key='$($env:xWebConfigKeyValueIntegrationKey)']" ` - -Name 'value').Value - $changedValue | Should Be $env:xWebConfigKeyValueIntegrationValueUpdated - } - - It 'Should remove AppSetting "xWebAdministration Integration Tests Key"' { - { - Invoke-Expression -Command "$($script:dscResourceName)_AppSetting_Absent -OutputPath `$TestDrive" - Start-DscConfiguration -Path $TestDrive -ComputerName localhost -Wait -Verbose -Force - } | Should Not throw - - [string] $appSetting = (Get-WebConfigurationProperty ` - -PSPath $env:xWebConfigKeyValuePsPath ` - -Filter "appSettings/add[@key='$($env:xWebConfigKeyValueIntegrationKey)']" ` - -Name 'value') - $appSetting | Should BeNullOrEmpty - } - } - #endregion - -} -finally -{ - Restore-WebConfigurationWrapper -Name $tempName -Verbose - - Remove-WebConfigurationBackup -Name $tempName -Verbose - - Restore-TestEnvironment -TestEnvironment $script:testEnvironment -Verbose -} - diff --git a/tests/Integration/MSFT_xWebConfigKeyValue.config.ps1 b/tests/Integration/MSFT_xWebConfigKeyValue.config.ps1 deleted file mode 100644 index 4eea1ffb6..000000000 --- a/tests/Integration/MSFT_xWebConfigKeyValue.config.ps1 +++ /dev/null @@ -1,41 +0,0 @@ - -configuration MSFT_xWebConfigKeyValue_Config -{ - Import-DscResource -ModuleName xWebAdministration - - xWebConfigKeyValue IntegrationAppSetting - { - Ensure = 'Present' - ConfigSection = 'AppSettings' - Key = $env:xWebConfigKeyValueIntegrationKey - Value = 'xWebAdministration Integration Tests Value' - WebsitePath = $env:xWebConfigKeyValuePsPath - } -} - -configuration MSFT_xWebConfigKeyValue_AppSetting_Update -{ - Import-DscResource -ModuleName xWebAdministration - - xWebConfigKeyValue IntegrationAppSetting - { - Ensure = 'Present' - ConfigSection = 'AppSettings' - Key = $env:xWebConfigKeyValueIntegrationKey - Value = $env:xWebConfigKeyValueIntegrationValueUpdated - WebsitePath = $env:xWebConfigKeyValuePsPath - } -} - -configuration MSFT_xWebConfigKeyValue_AppSetting_Absent -{ - Import-DscResource -ModuleName xWebAdministration - - xWebConfigKeyValue IntegrationAppSetting - { - Ensure = 'Absent' - ConfigSection = 'AppSettings' - Key = $env:xWebConfigKeyValueIntegrationKey - WebsitePath = $env:xWebConfigKeyValuePsPath - } -} diff --git a/tests/TestHelper/CommonTestHelper.psm1 b/tests/TestHelper/CommonTestHelper.psm1 index 234bb924d..fe8ce32dd 100644 --- a/tests/TestHelper/CommonTestHelper.psm1 +++ b/tests/TestHelper/CommonTestHelper.psm1 @@ -67,6 +67,19 @@ function Restore-WebConfigurationWrapper Start-Sleep -Seconds 10 } -Export-ModuleMember -Function @( - 'Restore-WebConfigurationWrapper' -) +function Reset-DscLcm +{ + [CmdletBinding()] + param () + + Write-Verbose -Message 'Resetting DSC LCM.' + + Stop-DscConfiguration -Force -ErrorAction SilentlyContinue + Remove-DscConfigurationDocument -Stage Current -Force + Remove-DscConfigurationDocument -Stage Pending -Force + Remove-DscConfigurationDocument -Stage Previous -Force +} + +Export-ModuleMember -Function ` + Restore-WebConfigurationWrapper, ` + Reset-DscLcm diff --git a/tests/Unit/MSFT_xIISFeatureDelegation.Tests.ps1 b/tests/Unit/DSC_IISFeatureDelegation.Tests.ps1 similarity index 88% rename from tests/Unit/MSFT_xIISFeatureDelegation.Tests.ps1 rename to tests/Unit/DSC_IISFeatureDelegation.Tests.ps1 index 58af1bcca..11194bbda 100644 --- a/tests/Unit/MSFT_xIISFeatureDelegation.Tests.ps1 +++ b/tests/Unit/DSC_IISFeatureDelegation.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xIISFeatureDelegation' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_IisFeatureDelegation' function Invoke-TestSetup { @@ -19,7 +19,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -59,13 +60,14 @@ try } #region Function Get-TargetResource - Describe 'MSFT_xIISFeatureDelegation\Get-TargetResource' { + Describe 'DSC_IisFeatureDelegation\Get-TargetResource' { BeforeAll { Mock -CommandName Assert-Module } Context 'When OverrideMode is set to Allow' { Mock -CommandName Get-WebConfiguration -MockWith { return $mockAllowOverrideMode } + Mock -CommandName Assert-Module $result = Get-TargetResource @allowTargetResourceParameters It 'Should return the correct properties' { @@ -76,6 +78,7 @@ try } Context 'When OverrideMode is set to Deny' { Mock -CommandName Get-WebConfiguration -MockWith { return $mockDenyOverrideMode } + Mock -CommandName Assert-Module $result = Get-TargetResource @denytargetResourceParameters It 'Should return the correct properties' { @@ -88,10 +91,8 @@ try #endregion #region Function Test-TargetResource - Describe 'MSFT_xIISFeatureDelegation\Test-TargetResource' { - BeforeAll { - Mock -CommandName Assert-Module - } + Describe 'DSC_IisFeatureDelegation\Test-TargetResource' { + Mock -CommandName Assert-Module Context 'When OverrideMode is set to Allow' { Mock -CommandName Get-WebConfiguration -MockWith { return $mockAllowOverrideMode } @@ -124,10 +125,12 @@ try #endregion #region Function Set-TargetResource - Describe 'MSFT_xIISFeatureDelegation\Set-TargetResource' { + Describe 'DSC_IisFeatureDelegation\Set-TargetResource' { Context 'When resource not in desired state' { - Mock -CommandName Set-WebConfiguration -ParameterFilter { $Filter -eq $allowTargetResourceParameters.Filter -and $PsPath -eq $allowTargetResourceParameters.Path } + Mock -CommandName Set-WebConfiguration -ParameterFilter ` + { $Filter -eq $allowTargetResourceParameters.Filter -and ` + $PsPath -eq $allowTargetResourceParameters.Path } Set-TargetResource @allowTargetResourceParameters @@ -139,7 +142,7 @@ try #endregion #region Helper functions - Describe 'MSFT_xIISFeatureDelegation\Get-OverrideMode' { + Describe 'DSC_IisFeatureDelegation\Get-OverrideMode' { $mockWebConfigOutput = @{ Metadata = @{ effectiveOverrideMode = $null @@ -149,7 +152,7 @@ try $getOverrideModeParameters = $allowTargetResourceParameters.clone() $getOverrideModeParameters.Remove('OverrideMode') - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'When OverrideMode is invalid' { It 'Should throw an error on null' { diff --git a/tests/Unit/MSFT_xIISLogging.Tests.ps1 b/tests/Unit/DSC_IISLogging.Tests.ps1 similarity index 97% rename from tests/Unit/MSFT_xIISLogging.Tests.ps1 rename to tests/Unit/DSC_IISLogging.Tests.ps1 index b63bbae73..e7252f9c2 100644 --- a/tests/Unit/MSFT_xIISLogging.Tests.ps1 +++ b/tests/Unit/DSC_IISLogging.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xIisLogging' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_IisLogging' function Invoke-TestSetup { @@ -18,7 +18,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -39,7 +40,7 @@ try } $MockCimLogCustomFields = @( - New-CimInstance -ClassName MSFT_xLogCustomField ` + New-CimInstance -ClassName DSC_LogCustomField ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' @@ -75,7 +76,7 @@ try $MockLogFlagsAfterSplit = [System.String[]] @('Date', 'Time', 'ClientIP', 'UserName', 'ServerIP', 'Method', 'UriStem', 'UriQuery', 'HttpStatus', 'Win32Status', 'TimeTaken', 'ServerPort', 'UserAgent', 'Referer', 'HttpSubStatus') - Describe "$script:dscResourceName\Get-TargetResource" { + Describe 'DSC_IisLogging\Get-TargetResource' { Context 'Correct hashtable is returned' { @@ -150,7 +151,7 @@ try } - Describe "$script:dscResourceName\Test-TargetResource" { + Describe 'DSC_IisLogging\Test-TargetResource' { Mock -CommandName Assert-Module -MockWith { } @@ -179,7 +180,6 @@ try Mock -CommandName Test-LogCustomField ` -MockWith { return $MockLogCustomFields } - $result = Test-TargetResource @MockLogParameters It 'Should return true' { @@ -478,7 +478,7 @@ try } } - Describe "$script:dscResourceName\Set-TargetResource" { + Describe 'DSC_IisLogging\Set-TargetResource' { Mock -CommandName Assert-Module -MockWith { } @@ -776,7 +776,7 @@ try } - Describe "$script:dscResourceName\ConvertTo-CimLogCustomFields" { + Describe 'DSC_IisLogging\ConvertTo-CimLogCustomFields' { $MockLogCustomFields = @{ LogFieldName = 'ClientEncoding' SourceName = 'Accept-Encoding' @@ -800,9 +800,9 @@ try } } - Describe "$script:dscResourceName\Test-LogCustomField" { + Describe 'DSC_IisLogging\Test-LogCustomField' { $MockCimLogCustomFields = @( - New-CimInstance -ClassName MSFT_xLogCustomField ` + New-CimInstance -ClassName DSC_LogCustomField ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' @@ -813,7 +813,7 @@ try ) $MockCimLogCustomFieldsEnsurePresentExplicitly = @( - New-CimInstance -ClassName MSFT_xLogCustomField ` + New-CimInstance -ClassName DSC_LogCustomField ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' @@ -825,7 +825,7 @@ try ) $MockCimLogCustomFieldsEnsureAbsent = @( - New-CimInstance -ClassName MSFT_xLogCustomField ` + New-CimInstance -ClassName DSC_LogCustomField ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' @@ -883,7 +883,7 @@ try } } - Describe "$script:dscResourceName\Compare-LogFlags" { + Describe 'DSC_IisLogging\Compare-LogFlags' { Context 'Returns false when LogFlags are incorrect' { @@ -931,10 +931,10 @@ try } } - Describe "$script:dscResourceName\Set-LogCustomField" { + Describe 'DSC_IisLogging\Set-LogCustomField' { $MockCimLogCustomFields = @( - New-CimInstance -ClassName MSFT_xLogCustomField ` + New-CimInstance -ClassName DSC_LogCustomField ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' @@ -945,7 +945,7 @@ try ) $MockCimLogCustomFieldsEnsurePresentExplicitly = @( - New-CimInstance -ClassName MSFT_xLogCustomField ` + New-CimInstance -ClassName DSC_LogCustomField ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' @@ -957,7 +957,7 @@ try ) $MockCimLogCustomFieldsEnsureAbsent = @( - New-CimInstance -ClassName MSFT_xLogCustomField ` + New-CimInstance -ClassName DSC_LogCustomField ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' diff --git a/tests/Unit/MSFT_xIisMimeTypeMapping.Tests.ps1 b/tests/Unit/DSC_IisMimeTypeMapping.Tests.ps1 similarity index 91% rename from tests/Unit/MSFT_xIisMimeTypeMapping.Tests.ps1 rename to tests/Unit/DSC_IisMimeTypeMapping.Tests.ps1 index 42d5975e7..e2b23d8d1 100644 --- a/tests/Unit/MSFT_xIisMimeTypeMapping.Tests.ps1 +++ b/tests/Unit/DSC_IisMimeTypeMapping.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xIisMimeTypeMapping' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_IisMimeTypeMapping' function Invoke-TestSetup { @@ -19,7 +19,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -55,7 +56,7 @@ try } #region testing Get-TargetResource - Describe 'MSFT_xIisMimeTypeMapping\Get-TargetResource' { + Describe 'DSC_IisMimeTypeMapping\Get-TargetResource' { Mock -CommandName Assert-Module Context 'When MimeType is Absent' { @@ -87,7 +88,7 @@ try #endregion #region testing Set-TargetResource - Describe 'MSFT_xIisMimeTypeMapping\Set-TargetResource' { + Describe 'DSC_IisMimeTypeMapping\Set-TargetResource' { Mock -CommandName Assert-Module Context 'When Adding a MimeType' { @@ -115,7 +116,7 @@ try #endregion #region testing Test-TargetResource - Describe 'MSFT_xIisMimeTypeMapping\Test-TargetResource' { + Describe 'DSC_IisMimeTypeMapping\Test-TargetResource' { Mock -CommandName Assert-Module Context 'When Mapping could not be found with Ensure = to Present' { @@ -154,7 +155,7 @@ try #endregion #region Get-Mapping - Describe 'MSFT_xIisMimeTypeMapping\Get-Mapping' { + Describe 'DSC_IisMimeTypeMapping\Get-Mapping' { Context 'When Running Get-Mapping with Extension and Type' { Mock -CommandName Get-WebConfiguration -MockWith { return $mockMapping } diff --git a/tests/Unit/MSFT_xSslSettings.Tests.ps1 b/tests/Unit/DSC_SslSettings.Tests.ps1 similarity index 94% rename from tests/Unit/MSFT_xSslSettings.Tests.ps1 rename to tests/Unit/DSC_SslSettings.Tests.ps1 index 9cf57b8ce..1823818b7 100644 --- a/tests/Unit/MSFT_xSslSettings.Tests.ps1 +++ b/tests/Unit/DSC_SslSettings.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xSslSettings' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_SslSettings' function Invoke-TestSetup { @@ -19,7 +19,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -32,7 +33,7 @@ Invoke-TestSetup try { InModuleScope $script:dscResourceName { - $script:dscResourceName = 'MSFT_xSslSettings' + $script:dscResourceName = 'DSC_SslSettings' Describe "$script:dscResourceName\Test-TargetResource" { Context 'Ensure is Present and SSLSettings is Present' { diff --git a/tests/Unit/MSFT_xWebAppPool.Tests.ps1 b/tests/Unit/DSC_WebAppPool.Tests.ps1 similarity index 99% rename from tests/Unit/MSFT_xWebAppPool.Tests.ps1 rename to tests/Unit/DSC_WebAppPool.Tests.ps1 index 10711e09d..3715a9c35 100644 --- a/tests/Unit/MSFT_xWebAppPool.Tests.ps1 +++ b/tests/Unit/DSC_WebAppPool.Tests.ps1 @@ -4,8 +4,8 @@ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')] param () -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebAppPool' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebAppPool' function Invoke-TestSetup { @@ -24,7 +24,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -1715,7 +1716,7 @@ try Describe "how '$($script:dscResourceName)\Set-TargetResource' responds to Ensure = 'Absent'" { - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Application pool exists and is started' { @@ -1795,7 +1796,7 @@ try Describe "how '$($script:dscResourceName)\Set-TargetResource' responds to Ensure = 'Present'" { - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Application pool does not exist' { @@ -3285,7 +3286,7 @@ try } - Describe "MSFT_xWebAppPool\Get-Property" { + Describe "DSC_WebAppPool\Get-Property" { It 'Should return the value of $appPool.property1' { $appPool = @{ property1 = 'result' } diff --git a/tests/Unit/MSFT_xWebAppPoolDefaults.Tests.ps1 b/tests/Unit/DSC_WebAppPoolDefaults.Tests.ps1 similarity index 94% rename from tests/Unit/MSFT_xWebAppPoolDefaults.Tests.ps1 rename to tests/Unit/DSC_WebAppPoolDefaults.Tests.ps1 index dfdfc1662..c52afc470 100644 --- a/tests/Unit/MSFT_xWebAppPoolDefaults.Tests.ps1 +++ b/tests/Unit/DSC_WebAppPoolDefaults.Tests.ps1 @@ -1,7 +1,7 @@ #region HEADER -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebAppPoolDefaults' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebAppPoolDefaults' function Invoke-TestSetup { @@ -20,7 +20,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -34,7 +35,7 @@ try { InModuleScope $script:dscResourceName { - Describe 'xWebAppPoolDefaults\Get-TargetResource' { + Describe 'WebAppPoolDefaults\Get-TargetResource' { BeforeAll { Mock -CommandName Assert-Module } @@ -81,7 +82,7 @@ try } } - Describe 'xWebAppPoolDefaults\Test-TargetResource' { + Describe 'WebAppPoolDefaults\Test-TargetResource' { BeforeAll { Mock -CommandName Assert-Module @@ -167,7 +168,7 @@ try } } - Describe 'xWebAppPoolDefaults\Set-TargetResource' { + Describe 'WebAppPoolDefaults\Set-TargetResource' { BeforeAll { Mock -CommandName Assert-Module } diff --git a/tests/Unit/MSFT_xWebApplication.Tests.ps1 b/tests/Unit/DSC_WebApplication.Tests.ps1 similarity index 98% rename from tests/Unit/MSFT_xWebApplication.Tests.ps1 rename to tests/Unit/DSC_WebApplication.Tests.ps1 index ede745064..f61aa62e8 100644 --- a/tests/Unit/MSFT_xWebApplication.Tests.ps1 +++ b/tests/Unit/DSC_WebApplication.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebApplication' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebApplication' function Invoke-TestSetup { @@ -18,7 +18,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -31,9 +32,9 @@ Invoke-TestSetup try { InModuleScope $script:dscResourceName { - $script:dscResourceName = 'MSFT_xWebApplication' + $script:dscResourceName = 'DSC_WebApplication' - $MockAuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation ` + $MockAuthenticationInfo = New-CimInstance -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{Anonymous=$true;Basic=$false;Digest=$false;Windows=$true} @@ -97,7 +98,7 @@ try Mock Test-AuthenticationEnabled { return $true } ` -ParameterFilter { ($Type -eq 'Windows') } - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Absent should return correctly' { @@ -155,7 +156,7 @@ try return $GetAuthenticationInfo } - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Web Application does not exist' { Mock -CommandName Get-WebApplication -MockWith { @@ -185,11 +186,11 @@ try Describe "how $script:dscResourceName\Test-TargetResource responds to Ensure = 'Present'" { - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Web Application does not exist' { - $MockAuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation ` + $MockAuthenticationInfo = New-CimInstance -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{Anonymous=$true;Basic=$false;Digest=$false;Windows=$false} @@ -362,7 +363,7 @@ try Mock Test-AuthenticationEnabled { return $false } ` -ParameterFilter { ($Type -eq 'Windows') } - $MockAuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation ` + $MockAuthenticationInfo = New-CimInstance -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{Anonymous=$true;Basic=$false;Digest=$false;Windows=$true} @@ -517,7 +518,7 @@ try return $MockAuthenticationInfo } - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Web Application exists' { Mock -CommandName Remove-WebApplication @@ -533,7 +534,7 @@ try Describe "how $script:dscResourceName\Set-TargetResource responds to Ensure = 'Present'" { - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Web Application does not exist' { @@ -753,7 +754,7 @@ try Mock -CommandName Set-WebConfiguration Mock -CommandName Set-Authentication - $MockAuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation ` + $MockAuthenticationInfo = New-CimInstance -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{Anonymous=$true;Basic=$false;Digest=$false;Windows=$true} @@ -1324,7 +1325,7 @@ try Mock -CommandName Set-WebConfigurationProperty - $AuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation ` + $AuthenticationInfo = New-CimInstance -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{Anonymous='true';Basic='false';Digest='false';Windows='false'} @@ -1417,7 +1418,7 @@ try } ) - $AuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation ` + $AuthenticationInfo = New-CimInstance -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{Anonymous='false';Basic='true';Digest='false';Windows='false'} @@ -1458,7 +1459,7 @@ try } ) - $AuthenticationInfo = New-CimInstance -ClassName MSFT_xWebApplicationAuthenticationInformation ` + $AuthenticationInfo = New-CimInstance -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{Anonymous='true';Basic='true';Digest='true';Windows='true'} diff --git a/tests/Unit/MSFT_WebApplicationHandler.Tests.ps1 b/tests/Unit/DSC_WebApplicationHandler.Tests.ps1 similarity index 96% rename from tests/Unit/MSFT_WebApplicationHandler.Tests.ps1 rename to tests/Unit/DSC_WebApplicationHandler.Tests.ps1 index 0d8e60c50..6b52cc9aa 100644 --- a/tests/Unit/MSFT_WebApplicationHandler.Tests.ps1 +++ b/tests/Unit/DSC_WebApplicationHandler.Tests.ps1 @@ -1,5 +1,5 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_WebApplicationHandler' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebApplicationHandler' function Invoke-TestSetup { @@ -18,7 +18,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -107,7 +108,7 @@ try $customWebHandlerAbsentParameters = $customWebHandlerParameters.clone() $customWebHandlerAbsentParameters.Ensure = 'Absent' - Describe 'MSFT_WebApplicationHandler/Get-TargetResource' { + Describe 'DSC_WebApplicationHandler/Get-TargetResource' { Context 'When Web handler is Absent' { @@ -159,7 +160,7 @@ try } } - Describe 'MSFT_WebApplicationHandler/Set-TargetResource' { + Describe 'DSC_WebApplicationHandler/Set-TargetResource' { Mock Set-WebConfigurationProperty Mock Remove-WebHandler @@ -239,7 +240,7 @@ try } } - Describe 'MSFT_WebApplicationHandler/Test-TargetResource' { + Describe 'DSC_WebApplicationHandler/Test-TargetResource' { Context 'When Web Handler is Present' { diff --git a/tests/Unit/MSFT_xWebConfigProperty.Tests.ps1 b/tests/Unit/DSC_WebConfigProperty.Tests.ps1 similarity index 95% rename from tests/Unit/MSFT_xWebConfigProperty.Tests.ps1 rename to tests/Unit/DSC_WebConfigProperty.Tests.ps1 index 0551843f7..ee32c9f5b 100644 --- a/tests/Unit/MSFT_xWebConfigProperty.Tests.ps1 +++ b/tests/Unit/DSC_WebConfigProperty.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebConfigProperty' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebConfigProperty' function Invoke-TestSetup { @@ -19,7 +19,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') -Force -Scope Global + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -46,8 +47,8 @@ Invoke-TestSetup try { InModuleScope $script:dscResourceName { - $script:dscModuleName = 'xWebAdministration' - $script:dscResourceName = 'MSFT_xWebConfigProperty' + $script:dscModuleName = 'WebAdministrationDsc' + $script:dscResourceName = 'DSC_WebConfigProperty' $script:presentParameters = @{ WebsitePath = 'MACHINE/WEBROOT/APPHOST' diff --git a/tests/Unit/MSFT_xWebConfigPropertyCollection.Tests.ps1 b/tests/Unit/DSC_WebConfigPropertyCollection.Tests.ps1 similarity index 97% rename from tests/Unit/MSFT_xWebConfigPropertyCollection.Tests.ps1 rename to tests/Unit/DSC_WebConfigPropertyCollection.Tests.ps1 index 93cdace58..2882987ab 100644 --- a/tests/Unit/MSFT_xWebConfigPropertyCollection.Tests.ps1 +++ b/tests/Unit/DSC_WebConfigPropertyCollection.Tests.ps1 @@ -1,7 +1,7 @@ #region HEADER -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebConfigPropertyCollection' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebConfigPropertyCollection' function Invoke-TestSetup { @@ -20,7 +20,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -33,8 +34,8 @@ Invoke-TestSetup try { InModuleScope $script:dscResourceName { - $script:dscModuleName = 'xWebAdministration' - $script:dscResourceName = 'MSFT_xWebConfigPropertyCollection' + $script:dscModuleName = 'WebAdministrationDsc' + $script:dscResourceName = 'DSC_WebConfigPropertyCollection' $script:presentParameters = @{ WebsitePath = 'MACHINE/WEBROOT/APPHOST' diff --git a/tests/Unit/MSFT_xWebVirtualDirectory.Tests.ps1 b/tests/Unit/DSC_WebVirtualDirectory.Tests.ps1 similarity index 95% rename from tests/Unit/MSFT_xWebVirtualDirectory.Tests.ps1 rename to tests/Unit/DSC_WebVirtualDirectory.Tests.ps1 index c2a015429..6faec7749 100644 --- a/tests/Unit/MSFT_xWebVirtualDirectory.Tests.ps1 +++ b/tests/Unit/DSC_WebVirtualDirectory.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebVirtualDirectory' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebVirtualDirectory' function Invoke-TestSetup { @@ -19,7 +19,8 @@ function Invoke-TestSetup -ResourceType 'Mof' ` -TestType 'Unit' - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -46,7 +47,7 @@ try Count = 1 } - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Directory is Present and PhysicalPath is Correct' { It 'Should return true' { @@ -103,7 +104,7 @@ try } Describe "$script:dscResourceName\Get-TargetResource" { - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Ensure = Absent and virtual directory does not exist' { It 'Should return the correct values' { @@ -162,7 +163,7 @@ try Describe "$script:dscResourceName\Set-TargetResource" { - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Ensure = Present and virtual directory does not exist' { It 'Should call New-WebVirtualDirectory' { diff --git a/tests/Unit/MSFT_xWebsite.Tests.ps1 b/tests/Unit/DSC_Website.Tests.ps1 similarity index 97% rename from tests/Unit/MSFT_xWebsite.Tests.ps1 rename to tests/Unit/DSC_Website.Tests.ps1 index 677c382de..ffeb24995 100644 --- a/tests/Unit/MSFT_xWebsite.Tests.ps1 +++ b/tests/Unit/DSC_Website.Tests.ps1 @@ -1,6 +1,6 @@ -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebSite' +$script:dscModuleName = 'WebAdministrationDsc' +$script:dscResourceName = 'DSC_WebSite' function Invoke-TestSetup { @@ -18,6 +18,9 @@ function Invoke-TestSetup -DSCResourceName $script:dscResourceName ` -ResourceType 'Mof' ` -TestType 'Unit' + + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') + Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') } function Invoke-TestCleanup @@ -30,7 +33,7 @@ Invoke-TestSetup try { InModuleScope $script:dscResourceName { - $script:dscResourceName = 'MSFT_xWebSite' + $script:dscResourceName = 'DSC_WebSite' # Make sure we don't have the original module in memory. Remove-Module -Name 'WebAdministration' -ErrorAction SilentlyContinue @@ -72,7 +75,7 @@ try ) $MockAuthenticationInfo = @( - New-CimInstance -ClassName MSFT_xWebAuthenticationInformation ` + New-CimInstance -ClassName DSC_WebAuthenticationInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Anonymous = 'true' @@ -123,7 +126,7 @@ try $MockLogFlagsAfterSplit = [System.String[]] @('Date','Time','ClientIP','UserName','ServerIP','Method','UriStem','UriQuery','HttpStatus','Win32Status','TimeTaken','ServerPort','UserAgent','Referer','HttpSubStatus') - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Website does not exist' { Mock -CommandName Get-Website @@ -325,7 +328,7 @@ try Describe "how $script:dscResourceName\Test-TargetResource responds to Ensure = 'Present'" { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -339,7 +342,7 @@ try ) $MockCimLogCustomFields = @( - (New-CimInstance -ClassName MSFT_xLogCustomFieldInformation ` + (New-CimInstance -ClassName DSC_LogCustomFieldInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'LogField1' @@ -348,7 +351,7 @@ try } ` -ClientOnly ), - (New-CimInstance -ClassName MSFT_xLogCustomFieldInformation ` + (New-CimInstance -ClassName DSC_LogCustomFieldInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'LogField2' @@ -438,7 +441,7 @@ try Count = 1 } - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'Website does not exist' { Mock -CommandName Get-Website @@ -580,7 +583,7 @@ try -ParameterFilter { ($Type -eq 'Windows') } $MockAuthenticationInfo = New-CimInstance ` - -ClassName MSFT_xWebAuthenticationInformation ` + -ClassName DSC_WebAuthenticationInformation ` -ClientOnly ` -Property @{ Anonymous=$true; Basic=$false; Digest=$false; Windows=$true } @@ -953,12 +956,12 @@ try Describe "how $script:dscResourceName\Set-TargetResource responds to Ensure = 'Present'" { $MockAuthenticationInfo = New-CimInstance ` - -ClassName MSFT_xWebApplicationAuthenticationInformation ` + -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{ Anonymous=$true; Basic=$false; Digest=$false; Windows=$true } $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -972,7 +975,7 @@ try ) $MockCimLogCustomFields = @( - New-CimInstance -ClassName MSFT_xLogCustomFieldInformation ` + New-CimInstance -ClassName DSC_LogCustomFieldInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' @@ -1068,7 +1071,7 @@ try $MockWebsiteGetItem.Path = 'WebAdministration::\\SERVERNAME\Sites\MockName' $MockWebsiteGetItem = [PSCustomObject]$MockWebsiteGetItem - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module Context 'All properties need to be updated and website must be started' { Mock -CommandName Add-WebConfiguration @@ -1758,7 +1761,7 @@ try Mock -CommandName Get-Website -MockWith { return @{Name = $MockParameters.Name} } - Mock -CommandName Assert-Module -MockWith {} + Mock -CommandName Assert-Module It 'Should call Remove-Website' { Mock -CommandName Remove-Website @@ -2274,7 +2277,7 @@ try Context 'Expected behaviour' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2314,7 +2317,7 @@ try Context 'IP address is invalid' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'http' @@ -2341,7 +2344,7 @@ try It 'should set the default HTTP port' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -2356,7 +2359,7 @@ try It 'should set the default HTTPS port' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -2373,7 +2376,7 @@ try Context 'Port is invalid' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'http' @@ -2410,7 +2413,7 @@ try $MockThumbprintWithLrmChar = $UnicodeEncoding.GetString(($LrmCharBytes + $UnicodeBytes)) $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2431,7 +2434,7 @@ try Context 'Protocol is HTTPS and CertificateThumbprint is not specified' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2455,7 +2458,7 @@ try Context 'Protocol is HTTPS and CertificateSubject is specified' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2483,7 +2486,7 @@ try Context 'Protocol is HTTPS and full CN of CertificateSubject is specified' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2511,7 +2514,7 @@ try Context 'Protocol is HTTPS and CertificateSubject is specified. Multiple matching certificates' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2544,7 +2547,7 @@ try Context 'Protocol is HTTPS and invalid CertificateSubject is specified' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2572,7 +2575,7 @@ try Context 'Protocol is HTTPS and CertificateStoreName is not specified' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2589,7 +2592,7 @@ try Context 'Protocol is HTTPS and HostName is not specified for use with Server Name Indication' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'https' @@ -2619,7 +2622,7 @@ try Context 'Protocol is not HTTPS' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'http' @@ -2640,7 +2643,7 @@ try Context 'Protocol is neither HTTP nor HTTPS' { It 'should throw an error if BindingInformation is not specified' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'net.tcp' @@ -2663,7 +2666,7 @@ try It 'should use BindingInformation and ignore IPAddress, Port, and HostName' { $MockBindingInfo = @( - New-CimInstance -ClassName MSFT_xWebBindingInformation ` + New-CimInstance -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ Protocol = 'net.tcp' @@ -2842,7 +2845,7 @@ try Mock -CommandName Set-WebConfigurationProperty $AuthenticationInfo = New-CimInstance ` - -ClassName MSFT_xWebApplicationAuthenticationInformation ` + -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{Anonymous='true';Basic='false';Digest='false';Windows='false'} @@ -2950,7 +2953,7 @@ try ) $AuthenticationInfo = New-CimInstance ` - -ClassName MSFT_xWebApplicationAuthenticationInformation ` + -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{ Anonymous='false'; Basic='true'; Digest='false'; Windows='false' } @@ -2986,7 +2989,7 @@ try ) $AuthenticationInfo = New-CimInstance ` - -ClassName MSFT_xWebApplicationAuthenticationInformation ` + -ClassName DSC_WebApplicationAuthenticationInformation ` -ClientOnly ` -Property @{ Anonymous='true'; Basic='true'; Digest='true'; Windows='true' } @@ -3008,7 +3011,7 @@ try Context 'BindingInfo is valid' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3022,7 +3025,7 @@ try } New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3044,7 +3047,7 @@ try Context 'BindingInfo contains multiple items with the same IPAddress, Port, and HostName combination' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3058,7 +3061,7 @@ try } New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3080,7 +3083,7 @@ try Context 'BindingInfo contains items that share the same Port but have different Protocols' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3094,7 +3097,7 @@ try } New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3116,7 +3119,7 @@ try Context 'BindingInfo contains multiple items with the same Protocol and BindingInformation combination' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3125,7 +3128,7 @@ try } New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3191,7 +3194,7 @@ try Context 'Test-BindingInfo returns False' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3224,7 +3227,7 @@ try Context 'Bindings comparison throws an error' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3255,7 +3258,7 @@ try Context 'Port is different' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3279,7 +3282,7 @@ try Context 'Protocol is different' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3303,7 +3306,7 @@ try Context 'IPAddress is different' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3327,7 +3330,7 @@ try Context 'HostName is different' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3350,7 +3353,7 @@ try Context 'CertificateThumbprint is different' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3391,7 +3394,7 @@ try Context 'CertificateStoreName is different' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3430,7 +3433,7 @@ try Context 'CertificateStoreName is different and no CertificateThumbprint is specified' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3479,7 +3482,7 @@ try Context 'SslFlags is different' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3518,7 +3521,7 @@ try Context 'Bindings are identical' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3532,7 +3535,7 @@ try } New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3580,7 +3583,7 @@ try Context 'Bindings are different' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3594,7 +3597,7 @@ try } New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3643,7 +3646,7 @@ try Context 'Two bindings with different certificate thumbprints' { $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3657,7 +3660,7 @@ try } New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3737,7 +3740,7 @@ try $MockBindingInfo = @( New-CimInstance ` - -ClassName MSFT_xWebBindingInformation ` + -ClassName DSC_WebBindingInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -ClientOnly ` -Property @{ @@ -3913,7 +3916,7 @@ try $MockWebsiteName = 'ContosoSite' $MockCimLogCustomFields = @( - New-CimInstance -ClassName MSFT_xLogCustomFieldInformation ` + New-CimInstance -ClassName DSC_LogCustomFieldInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' @@ -3965,7 +3968,7 @@ try $MockWebsiteName = 'ContosoSite' $MockCimLogCustomFields = @( - New-CimInstance -ClassName MSFT_xLogCustomFieldInformation ` + New-CimInstance -ClassName DSC_LogCustomFieldInformation ` -Namespace root/microsoft/Windows/DesiredStateConfiguration ` -Property @{ LogFieldName = 'ClientEncoding' diff --git a/tests/Unit/MSFT_xIISHandler.Tests.ps1 b/tests/Unit/MSFT_xIISHandler.Tests.ps1 deleted file mode 100644 index da882364a..000000000 --- a/tests/Unit/MSFT_xIISHandler.Tests.ps1 +++ /dev/null @@ -1,203 +0,0 @@ - -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xIISHandler' - -function Invoke-TestSetup -{ - try - { - Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' - } - catch [System.IO.FileNotFoundException] - { - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.' - } - - $script:testEnvironment = Initialize-TestEnvironment ` - -DSCModuleName $script:dscModuleName ` - -DSCResourceName $script:dscResourceName ` - -ResourceType 'Mof' ` - -TestType 'Unit' - - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') -} - -function Invoke-TestCleanup -{ - Restore-TestEnvironment -TestEnvironment $script:testEnvironment -} - -Invoke-TestSetup - -try -{ - #region Pester Tests - - InModuleScope $script:dscResourceName { - - #region Function Get-TargetResource - Describe 'MSFT_xIISHandler\Get-TargetResource' { - Context 'Ensure = Absent and Handler is not Present' { - Mock Assert-Module - Mock Get-Handler - - It 'Should return the right hashtable' { - $result = Get-TargetResource -Name 'StaticFile' -Ensure 'Absent' - $result.Ensure | Should Be 'Absent' - $result.Name | Should Be 'StaticFile' - } - } - Context 'Ensure = Present and Handler is Present' { - Mock Assert-Module - Mock Get-Handler {'Present'} - - It 'Should return the right hashtable' { - $result = Get-TargetResource -Name 'StaticFile' -Ensure 'Present' - $result.Ensure | Should Be 'Present' - $result.Name | Should Be 'StaticFile' - } - } - } - #endregion - - - #region Function Test-TargetResource - Describe 'MSFT_xIISHandler\Test-TargetResource' { - $Name = 'StaticFile' - - Context 'Handler is NULL and Ensure = Present' { - Mock Assert-Module - Mock Get-Handler - - $result = Test-TargetResource -Name $Name -Ensure 'Present' -Verbose *>&1 - It 'Should return False' { - $result[0] | Should Be $false - } - - It 'Should not return a verbose message' { - $result[1] | Should Be $null - } - } - - Context 'Handler is Present and Ensure = Present' { - Mock Assert-Module - Mock Get-Handler {'Present'} - - $result = Test-TargetResource -Name $Name -Ensure 'Present' -Verbose *>&1 - - It 'Should return the correct verbose message' { - $result[0] | Should Be ($script:localizedData.HandlerExists -f $Name) - } - - It 'Should return False' { - $result[1] | Should Be $true - } - } - - Context 'Handler is Present and Ensure = Absent' { - Mock Assert-Module - Mock Get-Handler {'Present'} - - $result = Test-TargetResource -Name $Name -Ensure 'Absent' -Verbose *>&1 - It 'Should return False' { - $result[0] | Should Be $false - } - - It 'Should not return a verbose message' { - $result[1] | Should Be $null - } - } - - Context 'Handler is Present and Ensure = Present' { - Mock Assert-Module - Mock Get-Handler - - $result = Test-TargetResource -Name $Name -Ensure 'Absent' -Verbose *>&1 - - It 'Should return the correct verbose message' { - $result[0] | Should Be ($script:localizedData.HandlerNotPresent -f $Name) - } - - It 'Should return False' { - $result[1] | Should Be $true - } - } - } - #endregion - - - #region Function Set-TargetResource - Describe 'MSFT_xIISHandler\Set-TargetResource' { - Context 'Ensure = Present and Handler is NOT present' { - $mockName = 'StaticFile' - Mock Assert-Module - Mock Get-Handler - Mock Add-Handler {} -ParameterFilter {$Name -eq $mockName} - - $message = Set-TargetResource -Name $mockName -Ensure 'Present' -Verbose 4>&1 - - It 'Should add the handler' { - Assert-MockCalled Add-Handler -ParameterFilter {$Name -eq $mockName} - } - - It 'Should call the right Verbose Message' { - $message | Should Be ($script:localizedData.AddingHandler -f $mockName) - } - } - - Context 'Ensure = Absent and Handler IS present' { - $mockName = 'StaticFile' - Mock Assert-Module - Mock Get-Handler {'Present'} - Mock Remove-WebConfigurationProperty - - $message = Set-TargetResource -Name $mockName -Ensure 'Absent' -Verbose 4>&1 - - It 'Should add the handler' { - Assert-MockCalled Remove-WebConfigurationProperty - } - - It 'Should call the right Verbose Message' { - $message | Should Be ($script:localizedData.RemovingHandler -f $mockName) - } - } - } - #endregion - - Describe 'MSFT_xIISHandler\Add-Handler' { - Context 'Should find all the handlers' { - foreach ($key in $script:handlers.keys) - { - Mock Add-WebConfigurationProperty {} -ParameterFilter {$Value -and $Value -eq $script:handlers[$key]} - - Add-Handler -Name $key - It "Should find $key in `$script:handler" { - Assert-MockCalled Add-WebConfigurationProperty -Exactly 1 -ParameterFilter {$Value -and $Value -eq $script:handlers[$key]} - } - } - } - - Context 'It should throw when it cannot find the handler' { - It 'Should throw an error' { - $keyName = 'Non-ExistantKey' - {Add-Handler -Name $keyName} | Should throw ($script:localizedData.HandlerNotSupported -f $KeyName) - } - } - } - - Describe 'MSFT_xIISHandler\Get-Handler' { - It 'Should call the mocks' { - $name = 'StaticFile' - $mockFilter = "system.webServer/handlers/Add[@Name='" + $name + "']" - Mock Get-WebConfigurationProperty {} -ParameterFilter {$Filter -and $Filter -eq $mockFilter} - Get-Handler -Name $Name - Assert-MockCalled Get-WebConfigurationProperty - } - } - } - #endregion -} -finally -{ - Invoke-TestCleanup -} diff --git a/tests/Unit/MSFT_xWebConfigKeyValue.Tests.ps1 b/tests/Unit/MSFT_xWebConfigKeyValue.Tests.ps1 deleted file mode 100644 index ff4788d7d..000000000 --- a/tests/Unit/MSFT_xWebConfigKeyValue.Tests.ps1 +++ /dev/null @@ -1,506 +0,0 @@ - -$script:dscModuleName = 'xWebAdministration' -$script:dscResourceName = 'MSFT_xWebConfigKeyValue' - -function Invoke-TestSetup -{ - try - { - Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop' - } - catch [System.IO.FileNotFoundException] - { - throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.' - } - - $script:testEnvironment = Initialize-TestEnvironment ` - -DSCModuleName $script:dscModuleName ` - -DSCResourceName $script:dscResourceName ` - -ResourceType 'Mof' ` - -TestType 'Unit' - - Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\MockWebAdministrationWindowsFeature.psm1') -} - -function Invoke-TestCleanup -{ - Restore-TestEnvironment -TestEnvironment $script:testEnvironment -} - -Invoke-TestSetup - -try -{ - InModuleScope $script:dscResourceName { - $script:dscModuleName = 'xWebAdministration' - $script:dscResourceName = 'MSFT_xWebConfigKeyValue' - - #region Function Get-TargetResource - Describe "$($script:dscResourceName)\Get-TargetResource" { - Context 'Value is absent' { - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName -MockWith { - return $null - } - - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - } - - $result = Get-TargetResource @parameters - - It 'Should return the correct values' { - $result.Ensure | Should Be 'Absent' - $result.Key | Should Be 'Key' - $result.Value | Should Be $null - } - - It 'Should have called Get-ItemValue the correct amount of times' { - Assert-MockCalled -CommandName Get-ItemValue -Times 2 -Exactly - } - } - - Context 'Value is present but not an attribute' { - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName ` - -ParameterFilter { $IsAttribute -eq $false } ` - -MockWith { return 'Value' } - - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - } - - $result = Get-TargetResource @parameters - - It 'Should return the correct values' { - $result.Ensure | Should Be 'Present' - $result.Key | Should Be 'Key' - $result.Value | Should Be 'Value' - } - - It 'Should have called Get-ItemValue the correct amount of times' { - Assert-MockCalled -CommandName Get-ItemValue -Times 1 -Exactly - } - } - - Context 'Value is present but is an attribute' { - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName -MockWith { - return $null - } - - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName ` - -ParameterFilter { $isAttribute -eq $true } ` - -MockWith { return 'Value' } - - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - } - - $result = Get-TargetResource @parameters - - It 'Should return the correct values' { - $result.Ensure | Should Be 'Present' - $result.Key | Should Be 'Key' - $result.Value | Should Be 'Value' - } - - It 'Should have called Get-ItemValue the correct amount of times' { - Assert-MockCalled -CommandName Get-ItemValue -Times 2 -Exactly - } - } - } - #endregion Function Get-TargetResource - - #region Function Test-TargetResource - Describe "$($script:dscResourceName)\Test-TargetResource" { - Context 'Ensure is present and is Attribute is False but value is null' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Value = 'Value' - Ensure = 'Present' - IsAttribute = $false - } - - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName ` - -ParameterFilter { $isAttribute -eq $false } ` - -MockWith { return $null } - - $result = Test-TargetResource @parameters - - It 'Should return false' { - $result | Should Be $false - } - } - - Context 'Ensure is present and is Attribute is False but value is an empty string' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Value = 'Value' - Ensure = 'Present' - IsAttribute = $false - } - - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName ` - -ParameterFilter { $isAttribute -eq $false } ` - -MockWith { return [System.String]::Empty } - - $result = Test-TargetResource @parameters - - It 'Should return false' { - $result | Should Be $false - } - } - - Context 'Ensure is present and is Attribute is False but value is wrong' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Value = 'Value' - Ensure = 'Present' - IsAttribute = $false - } - - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName ` - -ParameterFilter { $isAttribute -eq $false } ` - -MockWith { return 'WrongValue' } - - $result = Test-TargetResource @parameters - - It 'Should return false' { - $result | Should Be $false - } - } - - Context 'Ensure is present and is Attribute is False and the value is the same' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Value = 'Value' - Ensure = 'Present' - IsAttribute = $false - } - - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName ` - -ParameterFilter { $isAttribute -eq $false } ` - -MockWith { return 'Value' } - - $result = Test-TargetResource @parameters - - It 'Should return true' { - $result | Should Be $true - } - } - - Context 'Ensure is absent and the value is not null' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Value = 'Value' - Ensure = 'Absent' - IsAttribute = $false - } - - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName ` - -ParameterFilter { $isAttribute -eq $false } ` - -MockWith { return 'Value' } - - $result = Test-TargetResource @parameters - - It 'Should return false' { - $result | Should Be $false - } - } - - Context 'Ensure is absent and the value is null' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Value = 'Value' - Ensure = 'Absent' - IsAttribute = $false - } - - Mock -CommandName Get-ItemValue -ModuleName $script:dscResourceName ` - -ParameterFilter { $isAttribute -eq $false } ` - -MockWith { return $null } - - $result = Test-TargetResource @parameters - - It 'Should return true' { - $result | Should Be $true - } - } - } - #endregion Function Test-TargetResource - - - #region Function Set-TargetResource - Describe "$($script:dscResourceName)\Set-TargetResource" { - Context 'Ensure is Present and IsAttribute is False and value is not present' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Ensure = 'Present' - Value = 'Value' - IsAttribute = $false - } - - Mock -CommandName Get-ItemValue -MockWith { return $null } - Mock -CommandName Add-Item - - Set-TargetResource @parameters - - It 'Should call the right Mocks' { - Assert-MockCalled Get-ItemValue - Assert-MockCalled Add-Item - } - } - - Context 'Ensure is Present and IsAttribute is True and value is not present' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Ensure = 'Present' - Value = 'Value' - IsAttribute = $true - } - - Mock -CommandName Get-ItemValue -MockWith { return [System.String]::Empty } - Mock -CommandName Add-Item - - Set-TargetResource @parameters - - It 'Should call the right Mocks' { - Assert-MockCalled -CommandName Get-ItemValue - Assert-MockCalled -CommandName Add-Item - } - } - - Context 'Ensure is Present and IsAttribute is True and value is present' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Ensure = 'Present' - Value = 'Value' - IsAttribute = $true - } - - Mock -CommandName Get-ItemValue -MockWith { return 'Value' } - Mock -CommandName Edit-Item -MockWith { return $propertyName } - - $results = Set-TargetResource @parameters - - It 'Should call the right Mocks' { - Assert-MockCalled -CommandName Get-ItemValue - Assert-MockCalled -CommandName Edit-Item - } - - It 'Should use the right property value' { - $results | Should Be $parameters['Key'] - } - } - - Context 'Ensure is Present and IsAttribute is False and value is present' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Ensure = 'Present' - Value = 'Value' - IsAttribute = $false - } - - Mock -CommandName Get-ItemValue -MockWith { return 'Value' } - Mock -CommandName Edit-Item -MockWith { return $propertyName } - - $results = Set-TargetResource @parameters - - It 'Should call the right Mocks' { - Assert-MockCalled -CommandName Get-ItemValue - Assert-MockCalled -CommandName Edit-Item - } - - It 'Should use the right property value' { - $results | Should Be 'value' - } - } - - Context 'Ensure is Absent' { - $parameters = @{ - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - Key = 'Key' - Ensure = 'Absent' - Value = 'Value' - IsAttribute = $false - } - - Mock -CommandName Remove-Item - - Set-TargetResource @parameters - - It 'Should call the right Mocks' { - Assert-MockCalled -CommandName Remove-Item - } - } - } - #endregion Function Set-TargetResource - - #endregion Exported Function Unit Tests - - #region Non-Exported Function Unit Tests - Describe "$($script:dscResourceName)\Add-Item" { - Context 'IsAttribute is false' { - Mock -CommandName Add-WebConfigurationProperty -MockWith {} - - $parameters = @{ - Key = 'Key' - Value = 'Value' - IsAttribute = $false; - WebsitePath = 'C:\somePath\web.config' - ConfigSection = 'AppSettings' - } - - $result = Add-Item @parameters - - It 'Should call Add-WebConfigurationProperty' { - Assert-MockCalled -CommandName Add-WebConfigurationProperty - } - } - - Context 'IsAttribute is true' { - Mock -CommandName Set-WebConfigurationProperty -MockWith {} - - $parameters = @{ - Key = 'Key' - Value = 'Value' - IsAttribute = $true; - WebsitePath = 'C:\somePath\web.config' - ConfigSection = 'AppSettings' - } - - $result = Add-Item @parameters - - It 'Should call Set-WebConfigurationProperty' { - Assert-MockCalled -CommandName Set-WebConfigurationProperty - } - } - } - - Describe "$($script:dscResourceName)\Edit-Item" { - Context 'IsAttribute is false' { - Mock -CommandName Set-WebConfigurationProperty -MockWith { return $filter } - - $parameters = @{ - PropertyName = 'PropertyName' - OldValue = 'OldValue' - NewValue = 'NewValue' - IsAttribute = $false - WebsitePath = 'C:\test\web.config' - ConfigSection = 'AppSettings' - } - - $result = Edit-Item @parameters - - It 'Should have called the right command' { - $result | Should Be "AppSettings/add[@key='OldValue']" - } - - It 'Should have called Set-WebConfigurationProperty' { - Assert-MockCalled -CommandName Set-WebConfigurationProperty - } - } - - Context 'IsAttribute is true' { - Mock -CommandName Set-WebConfigurationProperty -MockWith { return $filter } - - $parameters = @{ - propertyName = 'PropertyName' - OldValue = 'OldValue' - NewValue = 'NewValue' - IsAttribute = $true - WebsitePath = 'C:\test\web.config' - ConfigSection = 'AppSettings' - } - - $result = Edit-Item @parameters - - It 'Should have called the right command' { - $result | Should Be 'AppSettings' - } - - It 'Should have called Set-WebConfigurationProperty' { - Assert-MockCalled -CommandName Set-WebConfigurationProperty - } - } - } - - Describe "$($script:dscResourceName)\Remove-Item" { - Context 'IsAttribute is false' { - Mock -CommandName Clear-WebConfiguration -MockWith { return $filter } - - $parameters = @{ - Key = 'Key' - IsAttribute = $false - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - } - - $results = Remove-Item @parameters - - It 'Should call the correct functions' { - Assert-MockCalled -CommandName Clear-WebConfiguration - } - - It 'Should use the right filter' { - $results | Should Be "AppSettings/add[@key='Key']" - } - - } - - Context 'IsAttribute is true' { - Mock -CommandName Clear-WebConfiguration -MockWith { return $filter } - Mock -CommandName Add-Item - - $parameters = @{ - Key = 'Key' - IsAttribute = $true - WebsitePath = 'C:\SomePath\web.config' - ConfigSection = 'AppSettings' - } - - $results = Remove-Item @parameters - - It 'Should call the correct functions' { - Assert-MockCalled -CommandName Clear-WebConfiguration -Exactly -Times 2 - Assert-MockCalled -CommandName Add-Item - } - - It 'Should use the right filter' { - $results[0] | Should Be "AppSettings/@Key" - $results[1] | Should Be "AppSettings/add[@key='dummyKey']" - } - } - } - #endregion Non-Exported Function Unit Tests - } -} -finally -{ - Invoke-TestCleanup -} diff --git a/tests/Unit/xWebAdministration.Common.Tests.ps1 b/tests/Unit/WebAdministrationDsc.Common.Tests.ps1 similarity index 60% rename from tests/Unit/xWebAdministration.Common.Tests.ps1 rename to tests/Unit/WebAdministrationDsc.Common.Tests.ps1 index f5df1625d..f011d9ca2 100644 --- a/tests/Unit/xWebAdministration.Common.Tests.ps1 +++ b/tests/Unit/WebAdministrationDsc.Common.Tests.ps1 @@ -1,12 +1,12 @@ <# - This module is loaded as a nested module when the xWebAdministration module is imported, + This module is loaded as a nested module when the WebAdministration module is imported, remove the module from the session to avoid the error message: - Multiple Script modules named 'xWebAdministration.Common' + Multiple Script modules named 'WebAdministration.Common' are currently loaded. Make sure to remove any extra copies of the module from your session before testing. #> -Get-Module -Name 'xWebAdministration.Common' -All | Remove-Module -Force +Get-Module -Name 'WebAdministration.Common' -All | Remove-Module -Force #region HEADER $script:projectPath = "$PSScriptRoot\..\.." | Convert-Path @@ -31,185 +31,6 @@ Import-Module -Name PSPKI InModuleScope $script:subModuleName { Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelper\CommonTestHelper.psm1') -Force - Describe 'xWebAdministration.Common\Get-LocalizedData' { - $mockTestPath = { - return $mockTestPathReturnValue - } - - $mockImportLocalizedData = { - $BaseDirectory | Should -Be $mockExpectedLanguagePath - } - - BeforeEach { - Mock -CommandName Test-Path -MockWith $mockTestPath -Verifiable - Mock -CommandName Import-LocalizedData -MockWith $mockImportLocalizedData -Verifiable - } - - Context 'When loading localized data for Swedish' { - $mockExpectedLanguagePath = 'sv-SE' - $mockTestPathReturnValue = $true - - It 'Should call Import-LocalizedData with sv-SE language' { - Mock -CommandName Join-Path -MockWith { - return 'sv-SE' - } -Verifiable - - { Get-LocalizedData -ResourceName 'DummyResource' } | Should -Not -Throw - - Assert-MockCalled -CommandName Join-Path -Exactly -Times 3 -Scope It - Assert-MockCalled -CommandName Test-Path -Exactly -Times 1 -Scope It - Assert-MockCalled -CommandName Import-LocalizedData -Exactly -Times 1 -Scope It - } - - $mockExpectedLanguagePath = 'en-US' - $mockTestPathReturnValue = $false - - It 'Should call Import-LocalizedData and fallback to en-US if sv-SE language does not exist' { - Mock -CommandName Join-Path -MockWith { - return $ChildPath - } -Verifiable - - { Get-LocalizedData -ResourceName 'DummyResource' } | Should -Not -Throw - - Assert-MockCalled -CommandName Join-Path -Exactly -Times 4 -Scope It - Assert-MockCalled -CommandName Test-Path -Exactly -Times 1 -Scope It - Assert-MockCalled -CommandName Import-LocalizedData -Exactly -Times 1 -Scope It - } - - Context 'When $ScriptRoot is set to a path' { - $mockExpectedLanguagePath = 'sv-SE' - $mockTestPathReturnValue = $true - - It 'Should call Import-LocalizedData with sv-SE language' { - Mock -CommandName Join-Path -MockWith { - return 'sv-SE' - } -Verifiable - - { Get-LocalizedData -ResourceName 'DummyResource' -ScriptRoot '.' } | Should -Not -Throw - - Assert-MockCalled -CommandName Join-Path -Exactly -Times 1 -Scope It - Assert-MockCalled -CommandName Test-Path -Exactly -Times 1 -Scope It - Assert-MockCalled -CommandName Import-LocalizedData -Exactly -Times 1 -Scope It - } - - $mockExpectedLanguagePath = 'en-US' - $mockTestPathReturnValue = $false - - It 'Should call Import-LocalizedData and fallback to en-US if sv-SE language does not exist' { - Mock -CommandName Join-Path -MockWith { - return $ChildPath - } -Verifiable - - { Get-LocalizedData -ResourceName 'DummyResource' -ScriptRoot '.' } | Should -Not -Throw - - Assert-MockCalled -CommandName Join-Path -Exactly -Times 2 -Scope It - Assert-MockCalled -CommandName Test-Path -Exactly -Times 1 -Scope It - Assert-MockCalled -CommandName Import-LocalizedData -Exactly -Times 1 -Scope It - } - } - } - - Context 'When loading localized data for English' { - Mock -CommandName Join-Path -MockWith { - return 'en-US' - } -Verifiable - - $mockExpectedLanguagePath = 'en-US' - $mockTestPathReturnValue = $true - - It 'Should call Import-LocalizedData with en-US language' { - { Get-LocalizedData -ResourceName 'DummyResource' } | Should -Not -Throw - } - } - - Assert-VerifiableMock - } - - Describe 'xWebAdministration.Common\New-InvalidResultException' { - Context 'When calling with Message parameter only' { - It 'Should throw the correct error' { - $mockErrorMessage = 'Mocked error' - - { New-InvalidResultException -Message $mockErrorMessage } | Should -Throw $mockErrorMessage - } - } - - Context 'When calling with both the Message and ErrorRecord parameter' { - It 'Should throw the correct error' { - $mockErrorMessage = 'Mocked error' - $mockExceptionErrorMessage = 'Mocked exception error message' - - $mockException = New-Object -TypeName 'System.Exception' -ArgumentList $mockExceptionErrorMessage - $mockErrorRecord = New-Object -TypeName 'System.Management.Automation.ErrorRecord' -ArgumentList @($mockException, $null, 'InvalidResult', $null) - - { New-InvalidResultException -Message $mockErrorMessage -ErrorRecord $mockErrorRecord } | Should -Throw ('System.Exception: {0} ---> System.Exception: {1}' -f $mockErrorMessage, $mockExceptionErrorMessage) - } - } - - Assert-VerifiableMock - } - - Describe 'xWebAdministration.Common\New-ObjectNotFoundException' { - Context 'When calling with Message parameter only' { - It 'Should throw the correct error' { - $mockErrorMessage = 'Mocked error' - - { New-ObjectNotFoundException -Message $mockErrorMessage } | Should -Throw $mockErrorMessage - } - } - - Context 'When calling with both the Message and ErrorRecord parameter' { - It 'Should throw the correct error' { - $mockErrorMessage = 'Mocked error' - $mockExceptionErrorMessage = 'Mocked exception error message' - - $mockException = New-Object -TypeName 'System.Exception' -ArgumentList $mockExceptionErrorMessage - $mockErrorRecord = New-Object -TypeName 'System.Management.Automation.ErrorRecord' -ArgumentList @($mockException, $null, 'InvalidResult', $null) - - { New-ObjectNotFoundException -Message $mockErrorMessage -ErrorRecord $mockErrorRecord } | Should -Throw ('System.Exception: {0} ---> System.Exception: {1}' -f $mockErrorMessage, $mockExceptionErrorMessage) - } - } - - Assert-VerifiableMock - } - - Describe 'xWebAdministration.Common\New-InvalidOperationException' { - Context 'When calling with Message parameter only' { - It 'Should throw the correct error' { - $mockErrorMessage = 'Mocked error' - - { New-InvalidOperationException -Message $mockErrorMessage } | Should -Throw $mockErrorMessage - } - } - - Context 'When calling with both the Message and ErrorRecord parameter' { - It 'Should throw the correct error' { - $mockErrorMessage = 'Mocked error' - $mockExceptionErrorMessage = 'Mocked exception error message' - - $mockException = New-Object -TypeName 'System.Exception' -ArgumentList $mockExceptionErrorMessage - $mockErrorRecord = New-Object -TypeName 'System.Management.Automation.ErrorRecord' -ArgumentList @($mockException, $null, 'InvalidResult', $null) - - { New-InvalidOperationException -Message $mockErrorMessage -ErrorRecord $mockErrorRecord } | Should -Throw ('System.InvalidOperationException: {0} ---> System.Exception: {1}' -f $mockErrorMessage, $mockExceptionErrorMessage) - } - } - - Assert-VerifiableMock - } - - Describe 'xWebAdministration.Common\New-InvalidArgumentException' { - Context 'When calling with both the Message and ArgumentName parameter' { - It 'Should throw the correct error' { - $mockErrorMessage = 'Mocked error' - $mockArgumentName = 'MockArgument' - - { New-InvalidArgumentException -Message $mockErrorMessage -ArgumentName $mockArgumentName } | Should -Throw ('Parameter name: {0}' -f $mockArgumentName) - } - } - - Assert-VerifiableMock - } - Describe 'DscResource.Common\Start-ProcessWithTimeout' { Context 'When starting a process successfully' { It 'Should return exit code 0' { @@ -237,49 +58,6 @@ InModuleScope $script:subModuleName { } } - Describe 'xWebAdministration.Common\Assert-Module' { - BeforeAll { - $testModuleName = 'TestModule' - } - - Context 'When module is not installed' { - BeforeAll { - Mock -CommandName Get-Module - } - - It 'Should throw the correct error' { - { Assert-Module -ModuleName $testModuleName } | Should -Throw ($script:localizedData.RoleNotFoundError -f $testModuleName) - } - } - - Context 'When module is available' { - BeforeAll { - Mock -CommandName Import-Module - Mock -CommandName Get-Module -MockWith { - return @{ - Name = $testModuleName - } - } - } - - Context 'When module should not be imported' { - It 'Should not throw an error' { - { Assert-Module -ModuleName $testModuleName } | Should -Not -Throw - - Assert-MockCalled -CommandName Import-Module -Exactly -Times 0 -Scope It - } - } - - Context 'When module should be imported' { - It 'Should not throw an error' { - { Assert-Module -ModuleName $testModuleName -ImportModule } | Should -Not -Throw - - Assert-MockCalled -CommandName Import-Module -Exactly -Times 1 -Scope It - } - } - } - } - Describe 'DscResource.Common\Test-DscPropertyState' -Tag 'TestDscPropertyState' { Context 'When comparing tables' { It 'Should return true for two identical tables' { @@ -487,252 +265,7 @@ InModuleScope $script:subModuleName { Assert-VerifiableMock } - Describe 'xWebAdministration.Common\Compare-ResourcePropertyState' { - Context 'When one property is in desired state' { - BeforeAll { - $mockCurrentValues = @{ - ComputerName = 'DC01' - } - - $mockDesiredValues = @{ - ComputerName = 'DC01' - } - } - - It 'Should return the correct values' { - $compareTargetResourceStateParameters = @{ - CurrentValues = $mockCurrentValues - DesiredValues = $mockDesiredValues - } - - $compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters - $compareTargetResourceStateResult | Should -HaveCount 1 - $compareTargetResourceStateResult.ParameterName | Should -Be 'ComputerName' - $compareTargetResourceStateResult.Expected | Should -Be 'DC01' - $compareTargetResourceStateResult.Actual | Should -Be 'DC01' - $compareTargetResourceStateResult.InDesiredState | Should -BeTrue - } - } - - Context 'When two properties are in desired state' { - BeforeAll { - $mockCurrentValues = @{ - ComputerName = 'DC01' - Location = 'Sweden' - } - - $mockDesiredValues = @{ - ComputerName = 'DC01' - Location = 'Sweden' - } - } - - It 'Should return the correct values' { - $compareTargetResourceStateParameters = @{ - CurrentValues = $mockCurrentValues - DesiredValues = $mockDesiredValues - } - - $compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters - $compareTargetResourceStateResult | Should -HaveCount 2 - $compareTargetResourceStateResult[0].ParameterName | Should -Be 'ComputerName' - $compareTargetResourceStateResult[0].Expected | Should -Be 'DC01' - $compareTargetResourceStateResult[0].Actual | Should -Be 'DC01' - $compareTargetResourceStateResult[0].InDesiredState | Should -BeTrue - $compareTargetResourceStateResult[1].ParameterName | Should -Be 'Location' - $compareTargetResourceStateResult[1].Expected | Should -Be 'Sweden' - $compareTargetResourceStateResult[1].Actual | Should -Be 'Sweden' - $compareTargetResourceStateResult[1].InDesiredState | Should -BeTrue - } - } - - Context 'When passing just one property and that property is not in desired state' { - BeforeAll { - $mockCurrentValues = @{ - ComputerName = 'DC01' - } - - $mockDesiredValues = @{ - ComputerName = 'APP01' - } - } - - It 'Should return the correct values' { - $compareTargetResourceStateParameters = @{ - CurrentValues = $mockCurrentValues - DesiredValues = $mockDesiredValues - } - - $compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters - $compareTargetResourceStateResult | Should -HaveCount 1 - $compareTargetResourceStateResult.ParameterName | Should -Be 'ComputerName' - $compareTargetResourceStateResult.Expected | Should -Be 'APP01' - $compareTargetResourceStateResult.Actual | Should -Be 'DC01' - $compareTargetResourceStateResult.InDesiredState | Should -BeFalse - } - } - - Context 'When passing two properties and one property is not in desired state' { - BeforeAll { - $mockCurrentValues = @{ - ComputerName = 'DC01' - Location = 'Sweden' - } - - $mockDesiredValues = @{ - ComputerName = 'DC01' - Location = 'Europe' - } - } - - It 'Should return the correct values' { - $compareTargetResourceStateParameters = @{ - CurrentValues = $mockCurrentValues - DesiredValues = $mockDesiredValues - } - - $compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters - $compareTargetResourceStateResult | Should -HaveCount 2 - $compareTargetResourceStateResult[0].ParameterName | Should -Be 'ComputerName' - $compareTargetResourceStateResult[0].Expected | Should -Be 'DC01' - $compareTargetResourceStateResult[0].Actual | Should -Be 'DC01' - $compareTargetResourceStateResult[0].InDesiredState | Should -BeTrue - $compareTargetResourceStateResult[1].ParameterName | Should -Be 'Location' - $compareTargetResourceStateResult[1].Expected | Should -Be 'Europe' - $compareTargetResourceStateResult[1].Actual | Should -Be 'Sweden' - $compareTargetResourceStateResult[1].InDesiredState | Should -BeFalse - } - } - - Context 'When passing a common parameter set to desired value' { - BeforeAll { - $mockCurrentValues = @{ - ComputerName = 'DC01' - } - - $mockDesiredValues = @{ - ComputerName = 'DC01' - Verbose = $true - } - } - - It 'Should return the correct values' { - $compareTargetResourceStateParameters = @{ - CurrentValues = $mockCurrentValues - DesiredValues = $mockDesiredValues - } - - $compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters - $compareTargetResourceStateResult | Should -HaveCount 1 - $compareTargetResourceStateResult.ParameterName | Should -Be 'ComputerName' - $compareTargetResourceStateResult.Expected | Should -Be 'DC01' - $compareTargetResourceStateResult.Actual | Should -Be 'DC01' - $compareTargetResourceStateResult.InDesiredState | Should -BeTrue - } - } - - Context 'When using parameter Properties to compare desired values' { - BeforeAll { - $mockCurrentValues = @{ - ComputerName = 'DC01' - Location = 'Sweden' - } - - $mockDesiredValues = @{ - ComputerName = 'DC01' - Location = 'Europe' - } - } - - It 'Should return the correct values' { - $compareTargetResourceStateParameters = @{ - CurrentValues = $mockCurrentValues - DesiredValues = $mockDesiredValues - Properties = @( - 'ComputerName' - ) - } - - $compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters - $compareTargetResourceStateResult | Should -HaveCount 1 - $compareTargetResourceStateResult.ParameterName | Should -Be 'ComputerName' - $compareTargetResourceStateResult.Expected | Should -Be 'DC01' - $compareTargetResourceStateResult.Actual | Should -Be 'DC01' - $compareTargetResourceStateResult.InDesiredState | Should -BeTrue - } - } - - Context 'When using parameter Properties and IgnoreProperties to compare desired values' { - BeforeAll { - $mockCurrentValues = @{ - ComputerName = 'DC01' - Location = 'Sweden' - Ensure = 'Present' - } - - $mockDesiredValues = @{ - ComputerName = 'DC01' - Location = 'Europe' - Ensure = 'Absent' - } - } - - It 'Should return the correct values' { - $compareTargetResourceStateParameters = @{ - CurrentValues = $mockCurrentValues - DesiredValues = $mockDesiredValues - IgnoreProperties = @( - 'Ensure' - ) - } - - $compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters - $compareTargetResourceStateResult | Should -HaveCount 2 - $compareTargetResourceStateResult[0].ParameterName | Should -Be 'ComputerName' - $compareTargetResourceStateResult[0].Expected | Should -Be 'DC01' - $compareTargetResourceStateResult[0].Actual | Should -Be 'DC01' - $compareTargetResourceStateResult[0].InDesiredState | Should -BeTrue - $compareTargetResourceStateResult[1].ParameterName | Should -Be 'Location' - $compareTargetResourceStateResult[1].Expected | Should -Be 'Europe' - $compareTargetResourceStateResult[1].Actual | Should -Be 'Sweden' - $compareTargetResourceStateResult[1].InDesiredState | Should -BeFalse - } - } - - Context 'When using parameter Properties and IgnoreProperties to compare desired values' { - BeforeAll { - $mockCurrentValues = @{ - ComputerName = 'DC01' - Location = 'Sweden' - Ensure = 'Present' - } - - $mockDesiredValues = @{ - ComputerName = 'DC01' - Location = 'Europe' - Ensure = 'Absent' - } - } - - It 'Should return and empty array' { - $compareTargetResourceStateParameters = @{ - CurrentValues = $mockCurrentValues - DesiredValues = $mockDesiredValues - Properties = @( - 'ComputerName' - ) - IgnoreProperties = @( - 'ComputerName' - ) - } - - $compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters - $compareTargetResourceStateResult | Should -BeNullOrEmpty - } - } - } - - Describe 'xWebAdministration.Common\New-CimCredentialInstance' { + Describe 'WebAdministration.Common\New-CimCredentialInstance' { Context 'When creating a new MSFT_Credential CIM instance credential object' { BeforeAll { $mockAdministratorUser = 'admin@contoso.com' @@ -753,7 +286,7 @@ InModuleScope $script:subModuleName { } } - Describe 'xWebAdministration.Common\Find-Certificate' { + Describe 'WebAdministration.Common\Find-Certificate' { # Generate the Valid certificate for testing but remove it from the store straight away $certDNSNames = @('www.fabrikam.com', 'www.contoso.com') $certificateCreationDNSNames = @('dns:www.fabrikam.com', 'dns:www.contoso.com') diff --git a/tests/xWebAdministration.TestHarness.psm1 b/tests/WebAdministrationDsc.TestHarness.psm1 similarity index 81% rename from tests/xWebAdministration.TestHarness.psm1 rename to tests/WebAdministrationDsc.TestHarness.psm1 index ae0a2ae6a..8cf322c7e 100644 --- a/tests/xWebAdministration.TestHarness.psm1 +++ b/tests/WebAdministrationDsc.TestHarness.psm1 @@ -1,21 +1,21 @@ -function Invoke-xWebAdministrationTests() { +function Invoke-WebAdministrationDscTests() { param ( [Parameter(Mandatory = $false)] [System.String] $TestResultsFile, - + [Parameter(Mandatory = $false)] [System.String] $DscTestsPath ) - Write-Verbose 'Commencing xWebAdministration unit tests' + Write-Verbose 'Commencing WebAdministrationDsc unit tests' $repoDir = Join-Path $PSScriptRoot '..' -Resolve $testCoverageFiles = @() - Get-ChildItem "$repoDir\DSCResources\**\*.psm1" -Recurse | ForEach-Object { + Get-ChildItem "$repoDir\DSCResources\**\*.psm1" -Recurse | ForEach-Object { if ($_.FullName -notlike '*\DSCResource.Tests\*') { - $testCoverageFiles += $_.FullName + $testCoverageFiles += $_.FullName } } @@ -24,18 +24,18 @@ function Invoke-xWebAdministrationTests() { $testResultSettings.Add('OutputFormat', 'NUnitXml' ) $testResultSettings.Add('OutputFile', $TestResultsFile) } - - Import-Module "$repoDir\xWebAdministration.psd1" - + + Import-Module "$repoDir\WebAdministrationDsc.psd1" + $versionsToTest = (Get-ChildItem (Join-Path $repoDir '\Tests\Unit\')).Name - + $testsToRun = @() $versionsToTest | ForEach-Object { $testsToRun += @(@{ 'Path' = "$repoDir\Tests\Unit\$_" }) } - + if ($PSBoundParameters.ContainsKey('DscTestsPath') -eq $true) { $testsToRun += @{ 'Path' = $DscTestsPath