Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Commit 55d95a5

Browse files
Use the server manager directly for this example
1 parent dc9f284 commit 55d95a5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

‎examples/02-CreateSite-Advanced/IIS.ps1‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ mkdir "C:\Sites\Website1" -ErrorAction SilentlyContinue
1414

1515
Import-Module IISAdministration
1616

17-
Start-IISCommitDelay
18-
19-
New-IISSite -Name "Website1" -BindingInformation "*:8022:" -PhysicalPath "C:\Sites\Website1"
20-
21-
$site = Get-IISSite -Name "Website1"
17+
$manager = Get-IISServerManager
18+
$site = $manager.Sites.Add("Website1", "http", "*:8022:", "C:\Sites\Website1")
2219
$site.Id = 4
2320
$site.Bindings.Add("*:8023:", "http")
2421
$site.Bindings.Add("*:8024:", "http")
25-
26-
Stop-IISCommitDelay -Commit $true
22+
$manager.CommitChanges()
2723

2824
# -----------------------------------------------------------------------------
2925
# Assert

‎examples/05-AssigningAppPools/IIS.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ if ((Get-IISAppPool -Name "My Pool") -eq $null) { Write-Error "My Pool not found
4747
Remove-IISSite -Name "Website1" -Confirm:$false
4848

4949
$manager = Get-IISServerManager
50-
$manager.ApplicationPools["My Pool 3"].Delete()
50+
$manager.ApplicationPools["My Pool"].Delete()
5151
$manager.CommitChanges()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /