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

Issue in Add-VSTeamWorkItem with non-english characters like german umlauts #397

Closed privatefunc closed 3 years ago

privatefunc commented 3 years ago

Exception occurs on Add-VSTeamWorkItem and Update-VSTeamWorkItem when non-english characters are in text fields like title or description. Is this an encoding problem or a problem with property validation?

Steps to reproduce


Set-VSTeamAccount -Account XXX -PersonalAccessToken XXXXXXXX
Set-VSTeamDefaultProject XXX

Add-VSTeamWorkItem -Title "Ä title with a German umlaut" -Description "Ä same problem in description" -WorkItemType Epic

Expected behavior

A new epic is created with proper title and description including non-english characters.

Actual behavior

An exception occurs

WARNUNG: You must pass a valid patch document in the body of the request.
Invoke-RestMethod : {"$id":"1","innerException":null,"message":"You must pass a valid patch document in the body of the 
request.","typeName":"Microsoft.VisualStudio.Services.Common.VssPropertyValidationException, 
Microsoft.VisualStudio.Services.Common","typeKey":"VssPropertyValidationException","errorCode":0,"eventId":3000}
In C:\Program Files\WindowsPowerShell\Modules\VSTeam\7.2.0\vsteam.functions.ps1:261 Zeichen:18
+          $resp = Invoke-RestMethod @params
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

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                      5.1.19041.906                                                                                                       
PSEdition                      Desktop                                                                                                             
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                             
BuildVersion                   10.0.19041.906                                                                                                      
CLRVersion                     4.0.30319.42000                                                                                                     
WSManStackVersion              3.0                                                                                                                 
PSRemotingProtocolVersion      2.3                                                                                                                 
SerializationVersion           1.1.0.1   
SebastianSchuetze commented 3 years ago

Thanks for reporting!

SebastianSchuetze commented 3 years ago

@privatefunc should be fixed now and go out with the next release