You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Thycotic.SecretServer module version 0.61.8 in PowerShell v7 against Secret Server version 11.7.000001. We are seeing errors trying to use template functions (e.g., Get-TssSecretTemplate) that cast the REST response to the [Thycotic.PowerShell.SecretTemplates.Template] type:
Error: "Cannot convert the "@{id=101; concurrencyId=45d0bd44-c076-4f0e-8848-8709404ca5c2; name=Example_Template_Name; fields=System.Object[]; passwordTypeId=}" value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.SecretTemplates.Template"."
The concurrencyId property seems to be causing the problem. We've found that we can work around this by removing that property before the cast. E.g., right above the cast to the Template type:
if ($restResponse) {
[Thycotic.PowerShell.SecretTemplates.Template]$restResponse
}
Remove the concurrencyId property, like so:
if ($restResponse) {
if ($restResponse.concurrencyId) {
$restResponse.PSObject.Properties.Remove('concurrencyID')
}
[Thycotic.PowerShell.SecretTemplates.Template]$restResponse
}
Please run the command using -Verbose
No response
Provide a test case or steps to reproduce
Use the product versions described above and try to get a template with Get-TssSecretTemplate.
Expected behavior
Template object is returned.
What Edition of Secret Server?
Professional
What version of Secret Server
Current GA release
What PowerShell host was used when producing this error
PowerShell Core (pwsh)
PowerShell Host Version
Name Value
---- -----
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
The text was updated successfully, but these errors were encountered:
Verified issue does not already exist?
Yes
What error did you receive
Using Thycotic.SecretServer module version 0.61.8 in PowerShell v7 against Secret Server version 11.7.000001. We are seeing errors trying to use template functions (e.g.,
Get-TssSecretTemplate
) that cast the REST response to the[Thycotic.PowerShell.SecretTemplates.Template]
type:Error: "Cannot convert the "@{id=101; concurrencyId=45d0bd44-c076-4f0e-8848-8709404ca5c2; name=Example_Template_Name; fields=System.Object[]; passwordTypeId=}" value of type "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.SecretTemplates.Template"."
The
concurrencyId
property seems to be causing the problem. We've found that we can work around this by removing that property before the cast. E.g., right above the cast to theTemplate
type:https://github.com/thycotic-ps/thycotic.secretserver/blob/dev/src/functions/secret-templates/Get-TssSecretTemplate.ps1#L64
Remove the
concurrencyId
property, like so:Please run the command using -Verbose
No response
Provide a test case or steps to reproduce
Use the product versions described above and try to get a template with
Get-TssSecretTemplate
.Expected behavior
Template object is returned.
What Edition of Secret Server?
Professional
What version of Secret Server
Current GA release
What PowerShell host was used when producing this error
PowerShell Core (pwsh)
PowerShell Host Version
The text was updated successfully, but these errors were encountered: