Powershell Tip #136: Read first and last byte of a file By powershellgu | November 17, 2018 0 Comment Tip: You can read the first and last byte of a file. PowerShell $byte = [System.IO.File]::ReadAllBytes('C:\Demo\test.txt') # First byte $byte[0] # Last byte $byte[-1] 1234567 $byte = [System.IO.File]::ReadAllBytes('C:\Demo\test.txt') # First byte$byte[0] # Last byte$byte[-1]