diff --git a/Actions/CheckForUpdates/CheckForUpdates.ps1 b/Actions/CheckForUpdates/CheckForUpdates.ps1 index 1d84a6c40..b9b3dd6d8 100644 --- a/Actions/CheckForUpdates/CheckForUpdates.ps1 +++ b/Actions/CheckForUpdates/CheckForUpdates.ps1 @@ -308,7 +308,7 @@ else { } } Write-Host "Update $($_.DstFile)" - $_.Content | Set-ContentLF -Path $_.DstFile + Set-ContentLF -Path $_.DstFile -Content $_.Content } if ($releaseNotes -eq "") { $releaseNotes = "No release notes available!" diff --git a/Actions/CheckForUpdates/yamlclass.ps1 b/Actions/CheckForUpdates/yamlclass.ps1 index f3b405b1a..908b20926 100644 --- a/Actions/CheckForUpdates/yamlclass.ps1 +++ b/Actions/CheckForUpdates/yamlclass.ps1 @@ -20,7 +20,7 @@ class Yaml { # Save the Yaml file with LF line endings using UTF8 encoding Save([string] $filename) { - $this.content | Set-ContentLF -Path $filename + Set-ContentLF -Path $filename -Content $this.content } # Find the lines for the specified Yaml path, given by $line diff --git a/Actions/CreateApp/AppHelper.psm1 b/Actions/CreateApp/AppHelper.psm1 index 19221df37..bcb3ad8e6 100644 --- a/Actions/CreateApp/AppHelper.psm1 +++ b/Actions/CreateApp/AppHelper.psm1 @@ -97,7 +97,7 @@ function UpdateALFile $al = $al.Replace("$_", $startId) $startId++ } - $al | Set-ContentLF -Path (Join-Path $destinationFolder $alFileName) + Set-ContentLF -Path (Join-Path $destinationFolder $alFileName) -Content $al } <# diff --git a/Actions/Github-Helper.psm1 b/Actions/Github-Helper.psm1 index c4439d7f4..ecd5f5926 100644 --- a/Actions/Github-Helper.psm1 +++ b/Actions/Github-Helper.psm1 @@ -715,12 +715,15 @@ function Set-ContentLF { Process { $path = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($path) if ($content -is [array]) { - $content = $content -join "`n" + Write-Host "array" + $contentStr = $content -join "`n" + Write-Host $contentStr } else { - $content = "$content".Replace("`r", "") + Write-Host "String" + $contentStr = "$content".Replace("`r", "") } - [System.IO.File]::WriteAllText($path, "$content`n") + [System.IO.File]::WriteAllText($path, "$contentStr`n") } } diff --git a/e2eTests/e2eTestHelper.psm1 b/e2eTests/e2eTestHelper.psm1 index 9900c4958..a79048c9a 100644 --- a/e2eTests/e2eTestHelper.psm1 +++ b/e2eTests/e2eTestHelper.psm1 @@ -337,7 +337,7 @@ function CreateNewAppInFolder { $folder = Join-Path $folder $name New-Item -Path $folder -ItemType Directory | Out-Null $appJson | Set-JsonContentLF -Path (Join-Path $folder "app.json") - $al -join "`n" | Set-ContentLF -Path (Join-Path $folder "$name.al") + Set-ContentLF -Path (Join-Path $folder "$name.al") -Content $al $id }