Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-VSTeamRequest call to API returning content application/octet-stream fails #564

Open
mnieto opened this issue Mar 4, 2024 · 0 comments
Labels
bug when a bug has been identified or filed

Comments

@mnieto
Copy link
Contributor

mnieto commented Mar 4, 2024

Steps to reproduce

$build = Get-VSTeamBuild -Definitions $pipelineId  -ResultFilter succeeded -Top 1
$artifacts = Get-VSTeamBuildArtifact -id $build.id
Invoke-VSTeamRequest -NoProject -area resources  -resource Containers -id "$($artifacts.id)/drop" -QueryString  @{ itemPath = "drop/myartifactfile.json" }

Expected behavior

As the artifact is a json file, I expect Invoke-VSTeamRequest manages the result and return a psobject representation of the json

As a workarround it's possible to provide the -OutFile parameter to save the content in a temp file and then do

Invoke-VSTeamRequest -NoProject -area resources  -resource Containers -id "$($artifacts.id)/drop" -QueryString  @{ itemPath = "drop/myartifactfile.json" } -OutFile temp.json
Get-Content temp.json | CovertFrom-Json

But this forces to save a file and remove it in an additional step

Actual behavior?

Exception: C:.....\PowerShell\Modules\VSTeam\7.13.0\vsteam.functions.ps1:279
Line |
279 | Write-Verbose $resp
| ~~~~~
| Cannot convert '
| ' to the type 'System.String' required by parameter 'Message'. Specified method is not supported.

On Which OS have you tried it?

Windows

What was your server version?

Azure DevOps Services

Other server version

No response

Log output of used API

Billing                     : 5.1-preview.1
Build                       : 5.1
Core                        : 5.1
DistributedTask             : 6.0-preview
DistributedTaskReleased     : 5.1
ExtensionsManagement        : 6.0-preview
Git                         : 5.1
Graph                       : 6.0-preview
HierarchyQuery              : 5.1-preview
MemberEntitlementManagement : 6.0-preview
Packaging                   : 6.0-preview
Pipelines                   : 5.1-preview
Policy                      : 5.1
Processes                   : 6.0-preview
Release                     : 5.1
ServiceEndpoints            : 5.0-preview
TaskGroups                  : 6.0-preview
Tfvc                        : 5.1
VariableGroups              : 5.1-preview.1
Version                     : AzD
Wiki                        : 6.0
WorkItemTracking            : 6.0-preview.1

Log output of $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.2
PSEdition                      Core
GitCommitId                    7.3.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@mnieto mnieto added the bug when a bug has been identified or filed label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug when a bug has been identified or filed
Projects
None yet
Development

No branches or pull requests

1 participant