diff --git a/DesiredStateGenerator/IIS/ApplicationDesiredState.cs b/DesiredStateGenerator/IIS/ApplicationDesiredState.cs index 05e2f5c..671e9c1 100644 --- a/DesiredStateGenerator/IIS/ApplicationDesiredState.cs +++ b/DesiredStateGenerator/IIS/ApplicationDesiredState.cs @@ -22,7 +22,9 @@ private void Initialize(Application application, string siteKey, string siteName this.Key = GetApplicationVariableName(siteName, application.Path); this.IsRootApplication = (application.Path == "/"); - AddAttribute("Name", application.Path); + string name = application.Path.StartsWith("/") ? application.Path.Substring(1) : application.Path; + AddAttribute("Name", name); + AddAttribute("Ensure", "Present"); AddAttribute("Website", siteName); AddAttribute("PhysicalPath", application.VirtualDirectories[0].PhysicalPath); diff --git a/DesiredStateGenerator/IIS/IISCodeGenerator.cs b/DesiredStateGenerator/IIS/IISCodeGenerator.cs index a0b7160..d972094 100644 --- a/DesiredStateGenerator/IIS/IISCodeGenerator.cs +++ b/DesiredStateGenerator/IIS/IISCodeGenerator.cs @@ -30,6 +30,7 @@ public string GenerateCode(IisPoolAndSitesOptions options) if (options.StandardizeAppPoolRecycles) sb.AppendLine(baseIndent + @"$appPoolRecycleHour = '02'"); + sb.AppendLine(baseIndent); if (options.IisPoolAndSitesGenerationMode == IisPoolAndSitesGenerationMode.ConfigFileOrder) @@ -128,7 +129,7 @@ private string GenerateSitesAndPools(IEnumerable siteList if (poolToGenerate != null) { code = GeneratePool(poolToGenerate); - sb.Append(code); + sb.AppendLine(code); poolsLeftToGenerate.Remove(poolToGenerate); } diff --git a/DesiredStateGenerator/IIS/PoolDesiredState.cs b/DesiredStateGenerator/IIS/PoolDesiredState.cs index dcadcaf..a83c91b 100644 --- a/DesiredStateGenerator/IIS/PoolDesiredState.cs +++ b/DesiredStateGenerator/IIS/PoolDesiredState.cs @@ -32,9 +32,6 @@ private void Initialize(ApplicationPool iisPoolObject, IISCodeGenerator.IisPoolA { string recycleTime = "$appPoolRecycleHour+':00:00'";//.Replace("'", "\""); this.AddAttributeWithOverrideValue("RestartSchedule", $"@({recycleTime})", GetScheduleString(iisPoolObject)); - - // this.AddAttributeWithOverrideValue("RestartSchedule", "@('02:00:00')", GetScheduleString(iisPoolObject)); - } else { diff --git a/DesiredStateGenerator/IIS/VirtualDirectoryDesiredState.cs b/DesiredStateGenerator/IIS/VirtualDirectoryDesiredState.cs index 216dfa6..b8f5073 100644 --- a/DesiredStateGenerator/IIS/VirtualDirectoryDesiredState.cs +++ b/DesiredStateGenerator/IIS/VirtualDirectoryDesiredState.cs @@ -18,7 +18,8 @@ private void Initialize(VirtualDirectory virtualDirectory, string siteName, stri this.IsRootOfAnApplication = (virtualDirectory.Path == "/"); - AddAttribute("Name", virtualDirectory.Path); + string name = virtualDirectory.Path.StartsWith("/") ? virtualDirectory.Path.Substring(1) : virtualDirectory.Path; + AddAttribute("Name", name); AddAttribute("Ensure", "Present"); AddAttribute("Website", siteName); diff --git a/DesiredStateGenerator/Properties/AssemblyInfo.cs b/DesiredStateGenerator/Properties/AssemblyInfo.cs index 1638921..9d8a684 100644 --- a/DesiredStateGenerator/Properties/AssemblyInfo.cs +++ b/DesiredStateGenerator/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.1")] -[assembly: AssemblyFileVersion("2.0.1")] +[assembly: AssemblyVersion("2.0.3")] +[assembly: AssemblyFileVersion("2.0.3")]