WebAdministrationDsc
WebAdministrationDsc copied to clipboard
Adding a Sub Virtual Directory Under a Virtual Directory
I'm trying to use the xWebAdministration to add a sub virtual directory under a virtual directory and I'm unable to create the sub-virtual directory within the virtual directory. Here's what I've tried so far:
if($_.Name -match "Images" -and $_.Website -match "Website") {
$AdminImagesVirtualDirectory = xWebVirtualDirectory "$($_.Website)_$($_.Name)_$($_.WebApplication)_Virt".Replace(" ","").Replace("/","_")
{
Name = $_.Name
Ensure = $_.Ensure
Website = $_.Website
PhysicalPath = $PhysicalPath
WebApplication = $_.WebApplication
DependsOn = $_.DependsOn
}
} elseif ($_.Name -match "Common" -and $_.Website -match "Website") {
xWebVirtualDirectory "$($_.Website)_$($AdminImagesVirtualDirectory.Name)_$($_.Name)_$($_.WebApplication)_Virt".Replace(" ","").Replace("/","_")
{
Name = $_.Name
Ensure = $_.Ensure
Website = $_.Website
PhysicalPath = $PhysicalPath
WebApplication = $_.WebApplication
DependsOn = $_.DependsOn
}
}
Basically, I am creating the images virtual directory first and then I'm trying to create the Common subdirectory under the images virtual directory. Is this supported?
Is there a way a better way to do this with xWebAdministration?
I was able to create a sub virtual directory by using images/common for the Name
Thanks for reporting this. Glad you found a solution. This should be documented, maybe as an example, and it should be added as an integration test.