I\'m writing a PowerShell script to perform certain administrative functions in IIS 7.5.
import-module WebAdministration
In some cases I kn
This is how you can get the site name:
$siteName = (Get-WebApplication -name 'YourApp').GetParentElement().Attributes['name'].Value
Or even shorter:
$siteName = (Get-WebApplication -name 'YourApp').GetParentElement()['name']