Created
September 19, 2019 15:38
-
-
Save tnt/90e228f0c41c915e6bea4781b4462989 to your computer and use it in GitHub Desktop.
A working version of https://devblogs.microsoft.com/scripting/creating-a-platform-independent-function-in-powershell/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ConvertFrom-HereString { | |
param ( | |
[string]$String='' | |
) | |
$CleanString = if ($PSVersionTable.PSEdition -eq 'Core'){ | |
$String | |
} else { | |
$String -replace "`r" | |
} | |
$CleanString.split("`n") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment