From 1e4b8f447731102eeab38b2ad5b25455f08232a0 Mon Sep 17 00:00:00 2001 From: Lucas Spits Date: Thu, 14 Sep 2017 20:30:44 +0200 Subject: [PATCH 1/2] Updated default ModuleVersion in ModuleManifest to 0.0.1 --- .../engine/Modules/NewModuleManifestCommand.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs index 1ea15017e1d..37bd1fa34bd 100644 --- a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs +++ b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs @@ -123,7 +123,7 @@ public Version ModuleVersion get { return _moduleVersion; } set { _moduleVersion = value; } } - private Version _moduleVersion = new Version(1, 0); + private Version _moduleVersion = new Version(0, 0, 1); /// /// Set the module description @@ -940,12 +940,12 @@ protected override void EndProcessing() // Now open the output file... PathUtils.MasterStreamOpen( this, - filePath, + filePath, #if UNIX - new UTF8Encoding(false), // UTF-8, no BOM -#else - EncodingConversion.Unicode, // UTF-16 with BOM -#endif + new UTF8Encoding(false), // UTF-8, no BOM +#else + EncodingConversion.Unicode, // UTF-16 with BOM +#endif /* defaultEncoding */ false, /* Append */ false, /* Force */ false, From 50622633bbb61f1fb29a79a1b124bc55abb87512 Mon Sep 17 00:00:00 2001 From: Lucas Spits Date: Thu, 14 Sep 2017 21:06:25 +0200 Subject: [PATCH 2/2] updates tests where manifests default versions where still matched agianst the old 1.0 version --- .../Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 index f56e52a93cc..a1c4e134920 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 @@ -53,8 +53,8 @@ Describe "Import-Module with ScriptsToProcess" -Tags "CI" { $testCases = @( @{ TestNameSuffix = 'for top-level module'; ipmoParms = @{'Name'='.\module1.psd1'}; Expected = '1' } @{ TestNameSuffix = 'for top-level and nested module'; ipmoParms = @{'Name'='.\module2.psd1'}; Expected = '21' } - @{ TestNameSuffix = 'for top-level module when -Version is specified'; ipmoParms = @{'Name'='.\module1.psd1'; 'Version'='1.0'}; Expected = '1' } - @{ TestNameSuffix = 'for top-level and nested module when -Version is specified'; ipmoParms = @{'Name'='.\module2.psd1'; 'Version'='1.0'}; Expected = '21' } + @{ TestNameSuffix = 'for top-level module when -Version is specified'; ipmoParms = @{'Name'='.\module1.psd1'; 'Version'='0.0.1'}; Expected = '1' } + @{ TestNameSuffix = 'for top-level and nested module when -Version is specified'; ipmoParms = @{'Name'='.\module2.psd1'; 'Version'='0.0.1'}; Expected = '21' } ) It "Verify ScriptsToProcess are executed " -TestCases $testCases {