From 975430d97ee037c60adef83c16361ff48dadbf52 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 23 Aug 2024 23:44:23 +0200 Subject: [PATCH] Fix compatibility with mixed new line characters --- scripts/Common/Scripts/Scripting.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Common/Scripts/Scripting.ps1 b/scripts/Common/Scripts/Scripting.ps1 index e508d405..29ac0567 100644 --- a/scripts/Common/Scripts/Scripting.ps1 +++ b/scripts/Common/Scripts/Scripting.ps1 @@ -51,6 +51,7 @@ function Write-PSScript { Import-Module PSScriptAnalyzer; $dirName = Split-Path -Parent $FileName; + $Script = ($Script -split "\r?\n") -join [System.Environment]::NewLine; $content = Invoke-Formatter -ScriptDefinition $Script; $exists = Test-Path -PathType Leaf $FileName;