Commits

Aaron Jensen  committed f6f4e62

Updating Get-IisApplication to return all applications under a website.

  • Participants
  • Parent commits 138a69d

Comments (0)

Files changed (1)

File Carbon/IIS/Get-IisApplication.ps1

     .EXAMPLE
     Get-IisApplication -SiteName 'DeathStar`
 
-    Gets the application running the `DeathStar` website.
+    Gets all the applications running under the `DeathStar` website.
+
+    .EXAMPLE
+    Get-IisApplication -SiteName 'DeathStar' -Name '/'
+
+    Demonstrates how to get the main application for a website: use `/` as the application name.
 
     .EXAMPLE
     Get-IisApplication -SiteName 'DeathStar' -Name 'MainPort/ExhaustPort'
     param(
         [Parameter(Mandatory=$true)]
         [string]
-        # The site where the application should be created.
+        # The site where the application is running.
         $SiteName,
         
         [Parameter()]
         [string]
-        # The name of the application.  Default is `/`, or the application running the website given by the `SiteName` parameter.
-        $Name = '/'
+        # The name of the application.  Default is to return all applications running under the website `$SiteName`.
+        $Name
     )
 
     $site = Get-IisWebsite -SiteName $SiteName
     {
         return
     }
+
     $site.Applications |
-        Where-Object { $_.Path -eq "/$Name" } | 
+        Where-Object {
+            if( $Name )
+            {
+                return ($_.Path -eq "/$Name")
+            }
+            return $true
+        } | 
         Add-IisServerManagerMember -ServerManager $site.ServerManager -PassThru |
         Add-Member -MemberType ScriptProperty -Name PhysicalPath -Value {
             $this.VirtualDirectories |