Skip to content

Instantly share code, notes, and snippets.

@raj-arun
Last active July 18, 2019 15:42
Show Gist options
  • Save raj-arun/bcd2ef48ee8f341c0c77f7679fd5001c to your computer and use it in GitHub Desktop.
Save raj-arun/bcd2ef48ee8f341c0c77f7679fd5001c to your computer and use it in GitHub Desktop.
Decodes base64 response and generate csv file
#Decode and Generate CSV File
[xml]$report = Get-Content output.xml
$EncodedString = $report.Envelope.Body.runReportResponse.runReportReturn.reportBytes
$DecodedString = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($EncodedString))
$DecodedString | Out-File "temp.txt"
Import-CSV "temp.txt" -delimiter "," | Export-CSV EPM_Account_Metadata.csv -NoType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment