{"id":20156157,"url":"https://github.com/dsccommunity/webadministrationdsc","last_synced_at":"2025-12-11T21:37:23.165Z","repository":{"id":30468279,"uuid":"34022265","full_name":"dsccommunity/WebAdministrationDsc","owner":"dsccommunity","description":"This module contains DSC resources for deploying and configuring web servers and related components.","archived":false,"fork":false,"pushed_at":"2024-11-13T11:00:33.000Z","size":2761,"stargazers_count":164,"open_issues_count":92,"forks_count":150,"subscribers_count":34,"default_branch":"main","last_synced_at":"2025-05-15T02:07:24.940Z","etag":null,"topics":["dsc","dsc-resources","iis","iis-configuration"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsccommunity.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-15T22:43:09.000Z","updated_at":"2025-03-10T20:26:47.000Z","dependencies_parsed_at":"2023-12-07T14:26:02.616Z","dependency_job_id":"f67c0e23-6ac6-4287-96e8-05651b2a4319","html_url":"https://github.com/dsccommunity/WebAdministrationDsc","commit_stats":null,"previous_names":["dsccommunity/xwebadministration","powershell/xwebadministration"],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FWebAdministrationDsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FWebAdministrationDsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FWebAdministrationDsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FWebAdministrationDsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsccommunity","download_url":"https://codeload.github.com/dsccommunity/WebAdministrationDsc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259383,"owners_count":22040820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dsc","dsc-resources","iis","iis-configuration"],"created_at":"2024-11-13T23:37:50.192Z","updated_at":"2025-12-11T21:37:23.158Z","avatar_url":"https://github.com/dsccommunity.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebAdministrationDsc\n\nThis module contains DSC resources for the management and configuration of Microsoft Internet Information Services (IIS).\n\n[![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\u0026branchName=main)\n![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/dsccommunity/WebAdministrationDsc/7/main)\n[![Azure DevOps tests](https://img.shields.io/azure-devops/tests/dsccommunity/WebAdministrationDsc/7/main)](https://dsccommunity.visualstudio.com/WebAdministrationDsc/_test/analytics?definitionId=7\u0026contextType=build)\n[![codecov](https://codecov.io/gh/dsccommunity/WebAdministrationDsc/branch/main/graph/badge.svg)](https://codecov.io/gh/dsccommunity/WebAdministrationDsc)\n[![PowerShell Gallery (with prereleases)](https://img.shields.io/powershellgallery/vpre/WebAdministrationDsc?label=WebAdministrationDsc%20Preview)](https://www.powershellgallery.com/packages/WebAdministrationDsc/)\n[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/WebAdministrationDsc?label=WebAdministrationDsc)](https://www.powershellgallery.com/packages/WebAdministrationDsc/)\n\n## Code of Conduct\n\nThis project has adopted this [Code of Conduct](CODE_OF_CONDUCT.md).\n\n## Releases\n\nFor each merge to the branch `main` a preview release will be\ndeployed to [PowerShell Gallery](https://www.powershellgallery.com/).\nPeriodically a release version tag will be pushed which will deploy a\nfull release to [PowerShell Gallery](https://www.powershellgallery.com/).\n\n## Contributing\n\nPlease check out common DSC Community [contributing guidelines](https://dsccommunity.org/guidelines/contributing).\n\n## Change log\n\nA full list of changes in each version can be found in the [change log](CHANGELOG.md).\n\n## Documentation\n\nThe documentation can be found in the [WebAdministration Wiki](https://github.com/dsccommunity/WebAdministrationDsc/wiki).\nThe DSC resources schema files is used to automatically update the\ndocumentation on each PR merge.\n\n### Examples\n\nYou can review the [Examples](/source/Examples) directory in the WebAdministration module\nfor some general use scenarios for all of the resources that are in the module.\n\nThe resource examples are also available in the [WebAdministration Wiki](https://github.com/dsccommunity/WebAdministrationDsc/wiki).\n\n### Registering PHP\n\nWhen configuring an IIS Application that uses PHP, you first need to register the PHP CGI module with IIS.\nThe following **xPhp** configuration downloads and installs the prerequisites for PHP, downloads PHP, registers the PHP CGI module with IIS and sets the system environment variable that PHP needs to run.\n\nNote: This example is intended to be used as a composite resource, so it does not use Configuration Data.\nPlease see the [Reusing Existing Configuration Scripts in PowerShell Desired State Configuration](https://devblogs.microsoft.com/powershell/reusing-existing-configuration-scripts-in-powershell-desired-state-configuration/) or it's [archived version](https://web.archive.org/web/20190421034455/https://devblogs.microsoft.com/powershell/reusing-existing-configuration-scripts-in-powershell-desired-state-configuration/) on how to use this configuration in another configuration.\n\n```powershell\n# Composite configuration to install the IIS pre-requisites for PHP\nConfiguration IisPreReqs_php\n{\n    param\n    (\n        [Parameter(Mandatory = $true)]\n        [Validateset(\"Present\",\"Absent\")]\n        [String]\n        $Ensure\n    )\n    foreach ($Feature in @(\"Web-Server\",\"Web-Mgmt-Tools\",\"web-Default-Doc\", `\n            \"Web-Dir-Browsing\",\"Web-Http-Errors\",\"Web-Static-Content\",`\n            \"Web-Http-Logging\",\"web-Stat-Compression\",\"web-Filtering\",`\n            \"web-CGI\",\"web-ISAPI-Ext\",\"web-ISAPI-Filter\"))\n    {\n        WindowsFeature \"$Feature$Number\"\n        {\n            Ensure = $Ensure\n            Name = $Feature\n        }\n    }\n}\n\n# Composite configuration to install PHP on IIS\nconfiguration xPhp\n{\n    param\n    (\n        [Parameter(Mandatory = $true)]\n        [switch] $installMySqlExt,\n        [Parameter(Mandatory = $true)]\n        [string] $PackageFolder,\n        [Parameter(Mandatory = $true)]\n        [string] $DownloadUri,\n        [Parameter(Mandatory = $true)]\n        [string] $Vc2012RedistDownloadUri,\n        [Parameter(Mandatory = $true)]\n        [String] $DestinationPath,\n        [Parameter(Mandatory = $true)]\n        [string] $ConfigurationPath\n    )\n        # Make sure the IIS Prerequisites for PHP are present\n        IisPreReqs_php Iis\n        {\n            Ensure = \"Present\"\n            # Removed because this dependency does not work in\n            # Windows Server 2012 R2 and below\n            # This should work in WMF v5 and above\n            # DependsOn = \"[File]PackagesFolder\"\n        }\n\n        # Download and install Visual C Redist2012 from chocolatey.org\n        Package vcRedist\n        {\n            Path = $Vc2012RedistDownloadUri\n            ProductId = \"{CF2BEA3C-26EA-32F8-AA9B-331F7E34BA97}\"\n            Name = \"Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.61030\"\n            Arguments = \"/install /passive /norestart\"\n        }\n\n        $phpZip = Join-Path $PackageFolder \"php.zip\"\n\n        # Make sure the PHP archine is in the package folder\n        xRemoteFile phpArchive\n        {\n            uri = $DownloadURI\n            DestinationPath = $phpZip\n        }\n\n        # Make sure the content of the PHP archine are in the PHP path\n        Archive php\n        {\n            Path = $phpZip\n            Destination  = $DestinationPath\n        }\n\n        if ($installMySqlExt )\n        {\n            # Make sure the MySql extention for PHP is in the main PHP path\n            File phpMySqlExt\n            {\n                SourcePath = \"$($DestinationPath)\\ext\\php_mysql.dll\"\n                DestinationPath = \"$($DestinationPath)\\php_mysql.dll\"\n                Ensure = \"Present\"\n                DependsOn = @(\"[Archive]PHP\")\n                MatchSource = $true\n            }\n        }\n\n        # Make sure the php.ini is in the Php folder\n        File PhpIni\n        {\n            SourcePath = $ConfigurationPath\n            DestinationPath = \"$($DestinationPath)\\php.ini\"\n            DependsOn = @(\"[Archive]PHP\")\n            MatchSource = $true\n        }\n\n        # Make sure the php cgi module is registered with IIS\n        IisModule phpHandler\n        {\n            Name = \"phpFastCgi\"\n            Path = \"$($DestinationPath)\\php-cgi.exe\"\n            RequestPath = \"*.php\"\n            Verb = \"*\"\n            Ensure = \"Present\"\n            DependsOn = @(\"[Package]vcRedist\",\"[File]PhpIni\")\n            # Removed because this dependency does not work in\n            # Windows Server 2012 R2 and below\n            # This should work in WMF v5 and above\n            # \"[IisPreReqs_php]Iis\"\n        }\n\n        # Make sure the php binary folder is in the path\n        Environment PathPhp\n        {\n            Name = \"Path\"\n            Value = \";$($DestinationPath)\"\n            Ensure = \"Present\"\n            Path = $true\n            DependsOn = \"[Archive]PHP\"\n        }\n}\n\nxPhp -PackageFolder \"C:\\packages\" `\n    -DownloadUri  -DownloadUri \"http://windows.php.net/downloads/releases/php-5.5.13-Win32-VC11-x64.zip\" `\n    -Vc2012RedistDownloadUri \"http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe\" `\n    -DestinationPath \"C:\\php\" `\n    -ConfigurationPath \"C:\\MyPhp.ini\" `\n    -installMySqlExt $false\n```\n\n## Installation\n\n### From GitHub source code\n\nTo manually install the module, download the source code from GitHub and unzip\nthe contents to the '$env:ProgramFiles\\WindowsPowerShell\\Modules' folder.\n\n### From PowerShell Gallery\n\nTo install from the PowerShell gallery using PowerShellGet (in PowerShell 5.0)\nrun the following command:\n\n```powershell\nFind-Module -Name WebAdministrationDsc | Install-Module\n```\n\nTo confirm installation, run the below command and ensure you see the\nDSC resources available:\n\n```powershell\nGet-DscResource -Module WebAdministrationDsc\n```\n\n## Requirements\n\nThe minimum Windows Management Framework (PowerShell) version required is\n4.0 or higher.\n\n\u003eNote: In the CI pipeline the resource are only tested on PowerShell 5.1,\n\u003eso PowerShell 4.0 support is best effort as this time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsccommunity%2Fwebadministrationdsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsccommunity%2Fwebadministrationdsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsccommunity%2Fwebadministrationdsc/lists"}