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
447 stars 155 forks source link

ServiceConnections: WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2. #395

Closed mblaschke closed 3 years ago

mblaschke commented 3 years ago

When more complex service connections are created/modified the json is truncated and so it's not fully working.

There are multiple ConvertTo-Json without depth and the default depth is only 2 which results in truncated body data.

Steps to reproduce

Update-VSTeamServiceEndpoint `
    -ProjectName xxxxx `
    -id xxxxx`
    -object $complexObject

Expected behavior

no warning :)

Actual behavior

WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2.
WARNING: An error occurred: Response status code does not indicate success: 403 (Forbidden).                                                                                           WARNING: You need to be an organization/collection level Administrator of the service endpoint to perform this operation.

Environment data

OS

Server

> Get-VSTeamAPIVersion
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                     : VSTS
> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Darwin 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
SebastianSchuetze commented 3 years ago

Thanks. Would you feel confident to correct the depth parameter in the cmdlet?