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, 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 {