Skip to content

Need to handle the different Get-Content calls for different versions of pswh #597

Closed
@TylerLeonhardt

Description

@TylerLeonhardt

PSCore removed -Encoding Byte for -AsByteStream.

This line:

$contentBytes = Get-Content -Path $filePathName -Raw -Encoding Byte

We should handle this like:

$params = @{this=that}
if ($PSVersionTable.PSEdition -eq "Core")
{
    $params += @{AsByteStream=$true}
}
else
{
    $params += @{Encoding="Byte"}
}

Get-Content @params

This will fix at least 1 bug with psedit over ssh. This might actually fix psedit for PSCore on Windows.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions