@@ -19,6 +19,9 @@ $Manifest = '{0}\{1}.json' -f $ManifestPath, $ArtifactName
1919$Artifact = Get-Content - Path $Manifest - Raw | ConvertFrom-Json
2020
2121if ($Artifact.Status -eq ' Present' ) {
22+ Write-Verbose (' Copying {0} configuration files' -f $ArtifactName )
23+ $ConfigPath = $Artifact.Websites.MountPath + " \" + " Windows\System32\inetsrv\config"
24+ Copy-Item $ConfigPath $ManifestPath - Recurse
2225 $Result = '
2326RUN powershell.exe -ExecutionPolicy Bypass -Command \
2427 Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebserverRole, IIS-WebServer, IIS-WebServerManagementTools;'
@@ -30,15 +33,15 @@ RUN powershell.exe -ExecutionPolicy Bypass -Command \
3033 $Result += ' \{1}New-Item -Path {0} -ItemType directory; \{1}' -f $Artifact.Websites.PhysicalPath [$i ], " `r`n "
3134 $Result += ' New-Website -Name '' {0}'' -PhysicalPath "{1}";' -f ($Artifact.Websites.Name [$i ] -replace " '" , " ''" ), $Artifact.Websites.PhysicalPath [$i ], " `r`n "
3235 Write-Verbose - Message (' Copying files for {0} site' -f $Artifact.Websites.Name [$i ])
33- Copy-Item $SitePath $ManifestPath
34- $Add += " ADD {0} {1}`r`n " -f (Split-Path $Artifact.Websites.PhysicalPath [$i ] - Leaf), $Artifact.Websites.PhysicalPath [$i ]
36+ Copy-Item $SitePath $ManifestPath - Recurse
37+ $Add += " ADD {0} {1}`r`n " -f (Split-Path $Artifact.Websites.PhysicalPath [$i ] - Leaf), ( $Artifact.Websites.PhysicalPath [$i ] -Replace " \\ " , " / " )
3538 }
3639
3740 # ## Add IIS HTTP handlers to the Dockerfile
3841 foreach ($HttpHandler in $Artifact.HttpHandlers ) {
3942 $Result += ' New-WebHandler -Name "{0}" -Path "{1}" -Verb "{2}" \{3}' -f $HttpHandler.Name , $HttpHandler.Path , $HttpHandler.Verb , " `r`n "
4043 }
41-
44+ $Add += " Add config Windows/System32/inetsrv/ "
4245 Write-Output - InputObject ($Result + $Add )
4346
4447}
0 commit comments