Created
March 9, 2019 00:05
-
-
Save JeremyMorgan/71ae6ee34d66ad08bf947bad9cafc61a to your computer and use it in GitHub Desktop.
Get Folder by Application Name in IIS
This file contains hidden or 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
[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration") | |
$siteName = "Default Web Site" | |
$vApp = "/HV" | |
$serverManager = New-Object Microsoft.Web.Administration.ServerManager | |
$site = $serverManager.Sites | where { $_.Name -eq $siteName } | |
$rootApp = $site.Applications | where { $_.Path -eq $vApp } | |
$rootVdir = $rootApp.VirtualDirectories | where { $_.Path -eq "/" } | |
$prevPath = $rootVdir.PhysicalPath | |
#Set-OctopusVariable -name "PreviousPath" -value "$prevPath" | |
Write-Host $prevPath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment