From 986b1cedd9699f8ad925c1c35e9757907042b3db Mon Sep 17 00:00:00 2001 From: Robert Bleattler <40604784+rbleattler@users.noreply.github.com> Date: Wed, 24 Aug 2022 11:25:26 -0400 Subject: [PATCH 1/2] Create Sample7.ps1 for use in docs. PowerShell Sample for Docs (adding to https://github.com/MicrosoftDocs/iis-docs/blob/main/iis/configuration/system.webServer/security/access.md) --- .../system.webServer/validation/samples/sample7.ps1 | 1 + 1 file changed, 1 insertion(+) create mode 100644 iis/configuration/system.webServer/validation/samples/sample7.ps1 diff --git a/iis/configuration/system.webServer/validation/samples/sample7.ps1 b/iis/configuration/system.webServer/validation/samples/sample7.ps1 new file mode 100644 index 000000000..261725802 --- /dev/null +++ b/iis/configuration/system.webServer/validation/samples/sample7.ps1 @@ -0,0 +1 @@ +Set-WebConfigurationProperty //system.webServer/security/access -Value None From 275d539ed01ed01e20d476a9222beefd53420c30 Mon Sep 17 00:00:00 2001 From: Robert Bleattler <40604784+rbleattler@users.noreply.github.com> Date: Wed, 24 Aug 2022 11:30:56 -0400 Subject: [PATCH 2/2] Add PowerShell example Added PowerShell example using WebAdministration module --- iis/configuration/system.webServer/security/access.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iis/configuration/system.webServer/security/access.md b/iis/configuration/system.webServer/security/access.md index 50e21266a..7980743b8 100644 --- a/iis/configuration/system.webServer/security/access.md +++ b/iis/configuration/system.webServer/security/access.md @@ -116,3 +116,10 @@ The following examples make SSL required to access a Web site named Contoso. ### VBScript [!code-vb[Main](access/samples/sample6.vb)] + +### PowerShell +> [!NOTE] +> The `Set-WebConfigurationProperty` cmdlet is part of the [WebAdministration PowerShell module](https://docs.microsoft.com/en-us/powershell/module/webadministration/?view=windowsserver2022-ps). + +[!code-powershell[Main](access/samples/sample7.ps1)] +