diff --git a/Tests/PSGetPublishScript.Tests.ps1 b/Tests/PSGetPublishScript.Tests.ps1 index a2e845f3..d8883f54 100644 --- a/Tests/PSGetPublishScript.Tests.ps1 +++ b/Tests/PSGetPublishScript.Tests.ps1 @@ -86,6 +86,45 @@ function SuiteCleanup { RemoveItem $script:TempScriptsPath } +Describe PowerShell.PSGet.PublishNonEnglishCharacterScriptTests -Tags 'BVT' { + BeforeAll { + SuiteSetup + } + + AfterAll { + SuiteCleanup + } + + BeforeEach { + + } + + AfterEach { + RemoveItem "$script:PSGalleryRepoPath\*" + RemoveItem $script:PublishScriptFilePath + RemoveItem "$script:TempScriptsPath\*.ps1" + RemoveItem "$script:TempScriptsLiteralPath\*" + + } + + It "PublishScriptRoundTripsNonAnsiCharacters" { + $description = "Remplace toutes les occurrences d'un modèle de caractère" + New-ScriptFileInfo -Path $script:PublishScriptFilePath ` + -Version $script:PublishScriptVersion ` + -Author Author@contoso.com ` + -Description $description ` + -Force + + $sfi = Test-ScriptFileInfo -Path $script:PublishScriptFilePath + AssertEquals $description $sfi.Description + + Publish-Script -Path $script:PublishScriptFilePath -NuGetApiKey $script:ApiKey + $psgetItemInfo = Find-Script $script:PublishScriptName + + AssertEquals $description $psgetItemInfo.description + } + +} Describe PowerShell.PSGet.PublishScriptTests -Tags 'BVT','InnerLoop' { BeforeAll { SuiteSetup @@ -123,6 +162,7 @@ Describe PowerShell.PSGet.PublishScriptTests -Tags 'BVT','InnerLoop' { + # Purpose: Validate Publish-Script cmdlet with versioned script dependencies # # Action: @@ -1142,7 +1182,7 @@ Describe PowerShell.PSGet.PublishScriptTests -Tags 'BVT','InnerLoop' { # Purpose: Validate that Publish-Module prompts to upgrade NuGet.exe if local NuGet.exe file is less than minimum required version # - # Action: Publish-Script + # Action: Publish-Script # # Expected Result: Publish operation should fail, NuGet.exe should not upgrade to latest version # @@ -2128,4 +2168,4 @@ Describe PowerShell.PSGet.PublishScriptTests.P2 -Tags 'P2','OuterLoop' { AssertEquals $res2.Name $ScriptName "Find-Script didn't find the exact script which has dependencies, $res2" Assert ($res2.Dependencies.Name.Count -ge ($DepencyModuleNames.Count+$RequiredScripts.Count+1)) "Find-Script with -IncludeDependencies returned wrong results, $res4" } -} \ No newline at end of file +} diff --git a/src/PowerShellGet/private/functions/Publish-PSArtifactUtility.ps1 b/src/PowerShellGet/private/functions/Publish-PSArtifactUtility.ps1 index 390b1051..b1f662d9 100644 --- a/src/PowerShellGet/private/functions/Publish-PSArtifactUtility.ps1 +++ b/src/PowerShellGet/private/functions/Publish-PSArtifactUtility.ps1 @@ -471,7 +471,7 @@ $CsprojContent = @" Microsoft.PowerShell.Management\Remove-Item $NuspecPath -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -Confirm:$false -WhatIf:$false } - Microsoft.PowerShell.Management\Set-Content -Value $nuspec -Path $NuspecPath -Force -Confirm:$false -WhatIf:$false + Microsoft.PowerShell.Management\Set-Content -Value $nuspec -Path $NuspecPath -Force -Confirm:$false -WhatIf:$false -Encoding UTF8 # Create .nupkg file if($script:DotnetCommandPath) { @@ -553,7 +553,7 @@ $CsprojContent = @" if(Test-Path -Path $tempErrorFile -PathType Leaf) { $errorMsg = Microsoft.PowerShell.Management\Get-Content -Path $tempErrorFile -Raw - + if($errorMsg) { Write-Verbose -Message $errorMsg }