Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Read .pol file with -AsBytestream flag in PS v6+ #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martintoreilly
Copy link

As of Powershell version 6, reading the contents of a file using Get-Content <path-to-file> -Raw -Encoding Byte no longer works. Get-Content <path-to-file> -AsByteStream should be used instead.

See https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-content?view=powershell-6#parameters

@martintoreilly
Copy link
Author

It might be better for my check to be the other way round (check if version is greater than or equal to v6) as it seems psversiontable only exists from Powershell v2 according to https://stackoverflow.com/questions/1825585/determine-installed-powershell-version

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant