From b602b6a9cdb7126116ea2688127f3afebde63793 Mon Sep 17 00:00:00 2001 From: Joshua Poehls Date: Thu, 5 Jul 2018 09:41:24 -0500 Subject: [PATCH] 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) --- perl.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl.json b/perl.json index d2eaa78ba4..a1ed7038ab 100644 --- a/perl.json +++ b/perl.json @@ -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",