Powershell Tip #135: Read file as a byte array By powershellgu | November 17, 2018 0 Comment Tip: You can read the content of a file as a byte array. PowerShell # Solution 1 Get-Content -Path 'C:\Demo\test.txt' -Encoding Byte # Solution 2 [System.IO.File]::ReadAllBytes('C:\Demo\test.txt') 12345 # Solution 1Get-Content -Path 'C:\Demo\test.txt' -Encoding Byte # Solution 2[System.IO.File]::ReadAllBytes('C:\Demo\test.txt')