AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
321 stars 131 forks source link

Invoke-JiraMethod - Add-Member : Cannot add a member with the name "toString" because a member with that name already exists. #495

Open hkelley opened 6 months ago

hkelley commented 6 months ago

Description

When using Invoke-JiraMethod -URI $uri with PSVersion 5.1, the following error is thrown:

Add-Member : Cannot add a member with the name "toString" because a member with that name already exists. To overwrite the member anyway, add the Force parameter to your command.

This seems to correspond to this line: https://github.com/AtlassianPS/JiraPS/blob/109dc3499ea08e1575ec328cbe7b15cdec258b96/JiraPS/Private/ConvertFrom-Json.ps1#L39

Steps To Reproduce

  1. Run this cmdlet
    `Invoke-JiraMethod -URI $uri `

Expected behavior

No warning messages

Screenshots

image

Your Environment

 Get-Module JiraPS -ListAvailable | Select Name, Version
$PSVersionTable

Name                      Version
----                      -------
JiraPS                    2.14.7 
JiraPS                    2.14.6 
PSVersion                        
PSEdition                        
PSCompatibleVersions             
BuildVersion                     
CLRVersion                       
WSManStackVersion                
PSRemotingProtocolVersion        
SerializationVersion       

Possible Solution

Add the -force option