Skip to content

Commit 922b356

Browse files
authored
fix ps5 issue in Push-BcNuGetPackage (#3769)
Co-authored-by: freddydk <[email protected]>
1 parent 0f49ca8 commit 922b356

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

NuGet/NuGetFeedClass.ps1

+5-4
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,12 @@ class NuGetFeed {
357357
$LF = "`r`n";
358358
$tmpFile = Join-Path ([System.IO.Path]::GetTempPath()) ([GUID]::NewGuid().ToString())
359359
$fs = [System.IO.File]::OpenWrite($tmpFile)
360+
$fs | Add-Member -MemberType ScriptMethod -Name WriteBytes -Value { param($bytes) $this.Write($bytes, 0, $bytes.Length) }
360361
try {
361-
$fs.Write([System.Text.Encoding]::UTF8.GetBytes("--$boundary$LF"))
362-
$fs.Write([System.Text.Encoding]::UTF8.GetBytes("Content-Type: application/octet-stream$($LF)Content-Disposition: form-data; name=package; filename=""$([System.IO.Path]::GetFileName($package))""$($LF)$($LF)"))
363-
$fs.Write([System.IO.File]::ReadAllBytes($package))
364-
$fs.Write([System.Text.Encoding]::UTF8.GetBytes("$LF--$boundary--$LF"))
362+
$fs.WriteBytes([System.Text.Encoding]::UTF8.GetBytes("--$boundary$LF"))
363+
$fs.WriteBytes([System.Text.Encoding]::UTF8.GetBytes("Content-Type: application/octet-stream$($LF)Content-Disposition: form-data; name=package; filename=""$([System.IO.Path]::GetFileName($package))""$($LF)$($LF)"))
364+
$fs.WriteBytes([System.IO.File]::ReadAllBytes($package))
365+
$fs.WriteBytes([System.Text.Encoding]::UTF8.GetBytes("$LF--$boundary--$LF"))
365366
} finally {
366367
$fs.Close()
367368
}

ReleaseNotes.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Issue 3762 Give Option to Choose SQL PowerShell Module When Restoring From BacPac
33
There are instances where sqlps does not work as expected when it is installed. This change adds a switch parameter, useSqlServerModule, to Restore-BcDatabaseFromArtifacts, New-NavContainer, and the BcContainerHelper config file.
44
Issue 1303 from AL-Go repository - renew federated token when access token needs renewal (works only for GitHub at this time)
5+
Regression when from PR 3760 - Push-BcNuGetPackage doesn't work on PowerSHell 5
56

67
6.0.29
78
Issue 3591 When using Publish-NAVApp to publish an app, which fails compilation in the service, the command might hang forever - the fix for this is a temporary hack put in place for the versions which doesn't work.

0 commit comments

Comments
 (0)