Skip to content

Commit

Permalink
Merge pull request #224 from gigi81/path-fix
Browse files Browse the repository at this point in the history
Fixed regression issue #222
  • Loading branch information
mbreakey3 authored Sep 2, 2016
2 parents 04820f9 + 0ca9e23 commit 532db4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ function Set-TargetResource
$webApplication.physicalPath -ne $PhysicalPath))
{
Write-Verbose -Message ($LocalizedData.VerboseSetTargetPhysicalPath -f $Name)
#Note: read this before touching the next line of code:
# https://github.com/PowerShell/xWebAdministration/issues/222
Set-WebConfigurationProperty `
-Filter $webApplication.ItemXPath `
-Filter "$($webApplication.ItemXPath)/virtualDirectory[@path='/']" `
-Name physicalPath `
-Value $PhysicalPath
}
Expand All @@ -164,6 +166,8 @@ function Set-TargetResource
($webApplication.applicationPool -ne $WebAppPool))
{
Write-Verbose -Message ($LocalizedData.VerboseSetTargetWebAppPool -f $Name)
#Note: read this before touching the next line of code:
# https://github.com/PowerShell/xWebAdministration/issues/222
Set-WebConfigurationProperty `
-Filter $webApplication.ItemXPath `
-Name applicationPool `
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/MSFT_xWebApplication.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ try
Assert-MockCalled -CommandName Get-WebApplication -Exactly 1
Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 1 `
-ParameterFilter { `
($Filter -eq "/system.applicationHost/sites/site[@name='MockSite']/application[@path='/MockPool']") -And `
($Filter -eq "/system.applicationHost/sites/site[@name='MockSite']/application[@path='/MockPool']/virtualDirectory[@path='/']") -And `
($Name -eq 'physicalPath') -And `
($Value -eq 'C:\MockSite\MockApp') `
}
Expand Down

0 comments on commit 532db4c

Please sign in to comment.