Skip to content

Instantly share code, notes, and snippets.

@sir-ragna
Created September 29, 2021 07:59
Show Gist options
  • Save sir-ragna/a2e78ce28505b996d344f879da5c7028 to your computer and use it in GitHub Desktop.
Save sir-ragna/a2e78ce28505b996d344f879da5c7028 to your computer and use it in GitHub Desktop.
# Powershell 5.1 version
ls *.wav | % { $file=$_; Get-Content $file.Name -Encoding byte -TotalCount 8 | Select -Last 4 | Foreach-Object {[byte]$a=0} {$a = $a -bor $_} {New-Object PSObject -Property @{status=$(if($a){'size set'}else{'no size set'});file=$file.Name}} }
# Powershell 7.1 version
ls *.wav | % { $file=$_; Get-Content $file.Name -AsByteStream -TotalCount 8 | Select -Last 4 | Foreach-Object {[byte]$a=0} {$a = $a -bor $_} {New-Object PSObject -Property @{status=$(if($a){'size set'}else{'no size set'});file=$file.Name}} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment