-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved example Sample_xWebsite_StopDefault out from README.md (#499)
- Loading branch information
Showing
3 changed files
with
36 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Examples/Resources/xWebSite/Sample_xWebsite_StopDefault.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<# | ||
.SYNOPSIS | ||
When configuring a new IIS server, several references recommend removing or stopping the default website for security purposes. | ||
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 | ||
{ | ||
param | ||
( | ||
# Target nodes to apply the configuration | ||
[string[]]$NodeName = 'localhost' | ||
) | ||
# Import the module that defines custom resources | ||
Import-DscResource -Module xWebAdministration | ||
Node $NodeName | ||
{ | ||
# Install the IIS role | ||
WindowsFeature IIS | ||
{ | ||
Ensure = "Present" | ||
Name = "Web-Server" | ||
} | ||
# Stop the default website | ||
xWebsite DefaultSite | ||
{ | ||
Ensure = "Present" | ||
Name = "Default Web Site" | ||
State = "Stopped" | ||
PhysicalPath = "C:\inetpub\wwwroot" | ||
DependsOn = "[WindowsFeature]IIS" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters