Powershell Tip #135: Read file as a byte array By powershellgu | November 17, 2018 2 Comments 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')
Pingback: Powershell Tip #134: Out-GridView with PassThru parameter | Powershell Guru
Pingback: Powershell Tip #136: Read first and last byte of a file | Powershell Guru