Public/Get-BcAppSymbolReference.ps1
function Get-BcAppSymbolReference { param ( [Parameter(Mandatory, Position = 0)] [string]$Path ) $Path = $PSCmdlet.GetUnresolvedProviderPathFromPSPath($Path) $FileStream = [System.IO.FileStream]::new($Path, 'Open') $MemoryStream = [System.IO.MemoryStream]::new() $FileStream.Seek(40, 'Begin') | Out-Null $FileStream.CopyTo($MemoryStream) $FileStream.Close() $MemoryStream.Seek(0, 'Begin') | Out-Null $ZipArchive = [System.IO.Compression.ZipArchive]::new($MemoryStream, 'Read') $ZipArchiveEntry = $ZipArchive.GetEntry('SymbolReference.json') $Stream = $ZipArchiveEntry.Open() $StreamReader = [System.IO.StreamReader]::new($Stream) $StreamReader.ReadToEnd() $StreamReader.Dispose() $Stream.Dispose() $ZipArchive.Dispose() $MemoryStream.Dispose() } |