Last active
December 29, 2017 17:52
-
-
Save yangyer/b1515e8a018015abff99fe0d84dbc1f7 to your computer and use it in GitHub Desktop.
Get IIS Sites Binding and Ports
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
Get-WebBinding | % { | |
$name = $_.ItemXPath -replace '(?:.*?)name=''([^'']*)(?:.*)', '$1' | |
New-Object psobject -Property @{ | |
Name = $name | |
Binding = $_.bindinginformation.Split(":")[-1] | |
Port = [int]::Parse($_.bindinginformation.Split(":")[1]) | |
} | |
} | | |
#Where-Object {$_.Name -like "Site1-*"} | | |
Sort-Object Port | | |
Out-GridView | |
Clear-Hosta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment