AttuneOps / Create-Windows-ISO-with-autounattend-built-on-macOS-or-Linux

This Attune Project provides an efficient and streamlined approach to creating customised Windows installation ISOs using the autounattend.

Home Page:https://github.attuneautomation.com/Automate-Windows-ISO-with-autounattend-built-on-macOS-or-Linux/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve Steps to Replace CRLF with LF

h4xhor opened this issue · comments

The CRLF with LF replacement currently done with opening a file and writing it back:

# Replace CRLF with LF
$text = [IO.File]::ReadAllText("$BUILD_DIR\$FILE") -replace "`r`n", "`n"
[IO.File]::WriteAllText("$BUILD_DIR\$FILE", $text)

can be done simpler with just:

# Replace CRLF with LF
$scriptContent = $scriptContent.replace("`r`n","`n")

image