Please advice how to get the list of my IIS applications(it's names) using PowerShell script.
If I run Get-IISSite
But I need all applications that is inside Default Web Site section.
Like to go through some foreach and retrieve all apps names that exists inside Default Web Site.
CodePudding user response:
You can try the following PowerShell script:
(get-webapplication -Site "Default Web Site" | select-object @{n='Site'; e= {$_.GetParentElement().Attributes['name'].value $_.path }},@{n='Location'; e= {$_.PhysicalPath}})
Below is the result of my test:
If you only want to get all applications name of the Default Web Site, you can write a powershell script like this:
(Get-ChildItem -Path 'IIS:\Sites\Default Web Site' | Where-Object {$_.NodeType -eq 'application'}).Name