Skip to content

Commit 1fd8924

Browse files
committed
* Updated **xIISModule** to add handler to specified site (issue dsccommunity#305).
* Updated **xIISModule** to parse verbs correctly (issue dsccommunity#323).
1 parent f18f516 commit 1fd8924

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

DSCResources/MSFT_xIisModule/MSFT_xIisModule.psm1

+15-16
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,23 @@ function Get-TargetResource
6060

6161
$handler = Get-IisHandler -Name $Name -SiteName $SiteName
6262

63-
if($handler )
63+
if($handler)
6464
{
6565
$Ensure = 'Present'
6666
$modulePresent = $true;
67-
}
6867

69-
foreach($thisVerb in $handler.Verb)
70-
{
71-
$currentVerbs += $thisVerb
68+
foreach($thisVerb in $handler.Verb.Split(','))
69+
{
70+
$currentVerbs += $thisVerb
71+
}
7272
}
7373

7474
$fastCgiSetup = $false
7575

7676
if($handler.Modules -eq 'FastCgiModule')
7777
{
7878
$fastCgi = Get-WebConfiguration /system.webServer/fastCgi/* `
79-
-PSPath (Get-IisSitePath `
80-
-SiteName $SiteName) | `
79+
-PSPath (Get-IisSitePath) | `
8180
Where-Object{$_.FullPath -ieq $handler.ScriptProcessor}
8281
if($fastCgi)
8382
{
@@ -152,19 +151,19 @@ function Set-TargetResource
152151
if(-not $resourceTests.ModulePresent -or -not $resourceTests.ModuleConfigured)
153152
{
154153
Write-Verbose -Message $LocalizedData.VerboseSetTargetAddHandler
155-
Add-webconfiguration /system.webServer/handlers iis:\ -Value @{
154+
Add-webconfiguration /system.webServer/handlers -PSPath (Get-IisSitePath -SiteName $SiteName) -Value @{
156155
Name = $Name
157156
Path = $RequestPath
158157
Verb = $Verb -join ','
159-
Module = $ModuleType
158+
Modules = $ModuleType
160159
ScriptProcessor = $Path
161160
}
162161
}
163162

164-
if(-not $resourceTests.EndPointSetup)
163+
if(-not $resourceStatus.EndPointSetup)
165164
{
166165
Write-Verbose -Message $LocalizedData.VerboseSetTargetAddfastCgi
167-
Add-WebConfiguration /system.webServer/fastCgi iis:\ -Value @{
166+
Add-WebConfiguration /system.webServer/fastCgi (Get-IisSitePath) -Value @{
168167
FullPath = $Path
169168
}
170169
}
@@ -344,19 +343,19 @@ function Test-TargetResourceImpl
344343
)
345344

346345
$matchedVerbs = @()
347-
$mismatchVerbs =@()
348-
foreach($thisVerb in $resourceStatus.Verb)
346+
$mismatchVerbs = @()
347+
foreach($thisVerb in $resourceStatus.Verb)
349348
{
350349
if($Verb -icontains $thisVerb)
351350
{
352351
Write-Verbose -Message ($LocalizedData.VerboseTestTargetResourceImplVerb `
353-
-f $Verb)
352+
-f $thisVerb)
354353
$matchedVerbs += $thisVerb
355354
}
356355
else
357356
{
358357
Write-Verbose -Message ($LocalizedData.VerboseTestTargetResourceImplExtraVerb `
359-
-f $Verb)
358+
-f $thisVerb)
360359
$mismatchVerbs += $thisVerb
361360
}
362361
}
@@ -379,7 +378,7 @@ function Test-TargetResourceImpl
379378
$moduleConfigured = $false
380379
if($modulePresent -and `
381380
$mismatchVerbs.Count -eq 0 -and `
382-
$matchedVerbs.Count-eq $Verb.Count -and `
381+
$matchedVerbs.Count -eq $Verb.Count -and `
383382
$resourceStatus.Path -eq $Path -and `
384383
$resourceStatus.RequestPath -eq $RequestPath)
385384
{

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ Please check out common DSC Resources [contributing guidelines](https://github.c
261261
## Versions
262262

263263
### Unreleased
264+
* Updated **xIISModule** to add handler to specified site (issue #305).
265+
* Updated **xIISModule** to parse verbs correctly (issue #323).
264266
* Updated **xWebSite** to include ability to manage custom logging fields
265267

266268
### 1.20.0.0

0 commit comments

Comments
 (0)