MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
442 stars 155 forks source link

URLEncoding of query string parameters #523

Closed sevaa closed 1 year ago

sevaa commented 1 year ago

PR Summary

Refactor to get rid of crude and incorrect _appendQueryString. Query string parameter values that can potentially be strings should be URLEncoded. Also, _appendQueryString was assuming that the URL already had a query string and produced invalid URLs if the API version was blank.

Fixes #442, #517

PR Checklist

sevaa commented 1 year ago

@SebastianSchuetze The tests are failing for me on PowerShell 5 because -Depth was not a valid parameter on ConvertFrom-Json until PS 6.2. Should I:

SebastianSchuetze commented 1 year ago

Do you mean they fail locally on your machine or are you talking about the test failing in the pipeline. In the future PS5 was planned to not be supported anymore with VSTeam. That would be Version 8.0.0. As for now I would suggest the one that makes the shift as easy as possible to version 8 but still working with 7.x.

Which would be the best option from your side?

sevaa commented 1 year ago

Failing on my machine. There is no PS5 build in the pipeline.

I'd prefer to remove the -Depth. This will break nothing.

PS5.1 is still the version that ships with Windows 10/11 and Windows Server. PS 6-7 is an optional install.

sevaa commented 1 year ago

@SebastianSchuetze Ready,