perl: Use [System.IO.File]::WriteAllBytes() instead of Set-Content -Encoding Byte to fix compatibility issue with PowerShell 6 which has removed -Encoding Byte in favor of a new -AsByteStream switch. (#2352)

This commit is contained in:
Joshua Poehls 2018-07-05 09:41:24 -05:00 committed by Richard Kuhnt
parent 0f0992994b
commit b602b6a9cd

View File

@ -16,7 +16,7 @@
"# enable standard idiomatic access to user's home directory",
"## remove HomeDir section from portable.perl (disables Portable.pm override of File::HomeDir)",
"## NOTE: conversion to byte[] avoids adding an extra trailing newline to the output file",
"[byte[]][char[]]((Get-Content -raw \"$dir\\portable.perl\") -replace \"(?ms)^HomeDir:.*?^(?=\\S)\",\"\") | Set-Content \"$dir\\portable.perl\" -encoding byte"
"[System.IO.File]::WriteAllBytes(\"$dir\\portable.perl\", ([byte[]][char[]]((Get-Content -Raw \"$dir\\portable.perl\") -replace \"(?ms)^HomeDir:.*?^(?=\\S)\",\"\")))"
],
"env_add_path": [
"perl\\site\\bin",