Skip to content

Save-TNReportResult.ps1 saves files with .zip extension but are not zip files #103

Description

@chrisbensch

I use this command to download report results and save locally:
Start-TNReport -ReportId 123 -wait | Get-TNReportResult | Save-TNReportResult -Path C:\Temp\reports

The report format is PDF yet the file on disk ends with .zip. It is actually a PDF with a bad name. Here is the line where this happens:
Line 47
$filename = Join-Path -Path $Path -ChildPath "$($file.Name.Split([IO.Path]::GetInvalidFileNameChars()) -join '')-$($file.Id)-reportresults.zip"

This happens with all report types, PDF and CSV, that I've generated. I couldn't find an option to save the files directly without change the name or adding zip to them.
Am I doing something wrong with my command?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions