Fix compatibility with mixed new line characters
This commit is contained in:
parent
d5c45fafc7
commit
975430d97e
1 changed files with 1 additions and 0 deletions
|
@ -51,6 +51,7 @@ function Write-PSScript {
|
||||||
|
|
||||||
Import-Module PSScriptAnalyzer;
|
Import-Module PSScriptAnalyzer;
|
||||||
$dirName = Split-Path -Parent $FileName;
|
$dirName = Split-Path -Parent $FileName;
|
||||||
|
$Script = ($Script -split "\r?\n") -join [System.Environment]::NewLine;
|
||||||
$content = Invoke-Formatter -ScriptDefinition $Script;
|
$content = Invoke-Formatter -ScriptDefinition $Script;
|
||||||
$exists = Test-Path -PathType Leaf $FileName;
|
$exists = Test-Path -PathType Leaf $FileName;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue