Powershell Tip #136: Read first and last byte of a file By powershellgu | November 17, 2018 2 Comments 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]
Pingback: Powershell Tip #135: Read file as a byte array | Powershell Guru
Pingback: Powershell Tip #137: Convert number to binary – Powershell Guru