Last active
May 14, 2023 16:41
-
-
Save SteveGilham/c916d7b360fae82bce4f36eaf22d5361 to your computer and use it in GitHub Desktop.
Revisions
-
SteveGilham revised this gist
May 14, 2023 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ [System.IO.Directory]::GetFiles((Get-Location), "?????-*.png") | Group-Object -Property {[System.DateTime]::Parse([System.IO.File]::GetCreationTime($_).ToShortDateString())} | Sort-Object -Property {[System.DateTime]::Parse($_.Name)} | % { $names = $_.Group | Sort-Object -Property {[System.IO.File]::GetCreationTime($_)} [PSCustomObject]@{ Key = $_.Name Value = $names } } | % { Write-Output ($_.Key.Split())[0] $_.Value | % { " `"$([System.IO.Path]::GetFileName($_).Substring(0,5))`"" | Write-Output $bytes = [System.IO.File]::ReadAllBytes($_) @@ -28,4 +28,4 @@ $index = ($index + 12 + $length) } } } -
SteveGilham created this gist
May 14, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ [System.IO.Directory]::GetFiles((Get-Location), "?????-*.png") | Group-Object -Property {[System.DateOnly]::FromDateTime([System.IO.File]::GetCreationTime($_))} | Sort-Object -Property {[System.DateOnly]::Parse($_.Name)} | % { $names = $_.Group | Sort-Object -Property {[System.IO.File]::GetCreationTime($_)} [PSCustomObject]@{ Key = $_.Name Value = $names } } | % { Write-Output $_.Key $_.Value | % { " `"$([System.IO.Path]::GetFileName($_).Substring(0,5))`"" | Write-Output $bytes = [System.IO.File]::ReadAllBytes($_) $index = 8 $found = $false while (($index -lt $bytes.Length) -and (-not $found)) { # Write-Output "index = $index" $field = ($bytes[$index+3], $bytes[$index+2], $bytes[$index+1], $bytes[$index]) $length = [System.BitConverter]::ToInt32($field, 0) # Write-Output "length = $length" $chunk = [System.Text.Encoding]::ASCII.GetString($bytes, $index+4, 4) # Write-Output "chunk = $chunk" if ($chunk.Equals("tEXt")) { $found = $true $body = [System.Text.Encoding]::ASCII.GetString($bytes, $index+19, $length - 11) Write-Output $body } $index = ($index + 12 + $length) } } }