# Converts Flipper SubGhz RAW Files to PSCustomObject[] function ConvertFrom-SubGhzRAW { param( [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] [String] $Path ) process { $data = Get-Content $Path if(!$data.Contains("Filetype: Flipper SubGhz RAW File")) { throw "$Path is not a Flipper SubGhz RAW File" } $data | Select-Object -Skip 5 | ForEach-Object { $_.Replace("RAW_Data: ", "") } | Join-String -Separator " " | Select-String -Pattern '(\d+)\s(-\d+)' -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { [PSCustomObject]@{ Tone = $_.Groups[1]; Silence = $_.Groups[2] } } } }