Skip to content

Commit 4ab8f4b

Browse files
committed
(MODULES-11188) Fix physicalPath on apps and sites
Prior to this commit it looks like we'd chosen the incorrect property to pull back from the iis config. PhysicalPath != physicalPath and the former was behaving differently between the app and site resources. This commit standardises on physicalPath which returns the correct value for both app and site resources. For clarity, physicalPath returns a string which we can directly manipulate if required.
1 parent 56e9b46 commit 4ab8f4b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/puppet/provider/templates/webadministration/_getwebsites.ps1.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Get-WebSite | % {
88
}
99

1010
$SiteEntityPath = "IIS:\\Sites\${name}"
11-
$SitePhysicalPath = Get-ItemProperty -Path $SiteEntityPath -Name PhysicalPath
11+
$SiteEntityPhysicalPath = Get-ItemProperty -Path $SiteEntityPath -Name physicalPath
1212

13-
if ($SitePhysicalPath.physicalpath.EndsWith('/')){
14-
$null = Set-ItemProperty -Path $SiteEntityPath -Name PhysicalPath -Value $SitePhysicalPath.physicalpath.TrimEnd('/') -Force
13+
if ($SiteEntityPhysicalPath.EndsWith('/')){
14+
$null = Set-ItemProperty -Path $SiteEntityPath -Name PhysicalPath -Value $SiteEntityPhysicalPath.TrimEnd('/') -Force
1515
}
1616

1717
$authenticationTypes = @(

lib/puppet/provider/templates/webadministration/getapps.ps1.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Get-WebApplication | % {
44
$name = [string]$pattern.replace($_.Path,'',1)
55
$site = [string]$_.ItemXPath.split("'")[1]
66

7-
$SiteEntityPath = "IIS:\\Sites\${site}"
8-
$SitePhysicalPath = Get-ItemProperty -Path $SiteEntityPath -Name PhysicalPath
7+
$AppEntityPath = "IIS:\\Sites\${site}\${name}"
8+
$AppEntityPhysicalPath = Get-ItemProperty -Path $AppEntityPath -Name physicalPath
99

10-
if ($SitePhysicalPath.physicalpath.EndsWith('/')){
11-
$null = Set-ItemProperty -Path $SiteEntityPath -Name PhysicalPath -Value $SitePhysicalPath.physicalpath.TrimEnd('/') -Force
10+
if ($AppEntityPhysicalPath.EndsWith('/')){
11+
$null = Set-ItemProperty -Path $AppEntityPath -Name physicalPath -Value $AppEntityPhysicalPath.TrimEnd('/') -Force
1212
}
1313

1414
$sslFlags = @()

0 commit comments

Comments
 (0)