JiraPS
JiraPS copied to clipboard
Invoke-JiraMethod - Add-Member : Cannot add a member with the name "toString" because a member with that name already exists.
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
- Run this cmdlet
`Invoke-JiraMethod -URI $uri `
Expected behavior
No warning messages
Screenshots
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
I would love to see this addressed as well. It hurts when retrieving Jira entities that contain "toString" as the field name, such as with Status fields.