Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting $restReponse to [Thycotic.PowerShell.Users.User] gives error #398

Open
deickhoff opened this issue Mar 5, 2024 · 3 comments
Open
Assignees
Labels
accepted bug or feature request accepted bug Something isn't working C# Class issue

Comments

@deickhoff
Copy link

deickhoff commented Mar 5, 2024

Verified issue does not already exist?

Yes

What error did you receive

InvalidArgument: C:\Program Files\PowerShell\7\Modules\Thycotic.SecretServer\functions\users\Get-TssUser.ps1:67
Line |
67 | [Thycotic.PowerShell.Users.User]$restResponse
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert value "@{DATA}" value of type
| "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Users.User"."

Please run the command using -Verbose

VERBOSE: Command invocation: get-tssuser -TssSession:TssSessionObject -Id:System.Int32[] -Verbose:True
VERBOSE: Performing the operation GET https://ridutrecht.secretservercloud.eu/api/v1/users/2
InvalidArgument: C:\Program Files\PowerShell\7\Modules\Thycotic.SecretServer\functions\users\Get-TssUser.ps1:67
Line |
67 | [Thycotic.PowerShell.Users.User]$restResponse
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert value "@{DATA}" value of type
| "System.Management.Automation.PSCustomObject" to type "Thycotic.PowerShell.Users.User"."

Provide a test case or steps to reproduce

For example Get-TssUser -TssSession $Session -Id 7 gives the error. But also the Update-TssUser gives the error, maybe for other commands too, but I haven't tried that.

Expected behavior

I expect the output to be usable. I still can read the output, like the properties of the given user, but it's not usable because I can't store it in a variable for example.

Possible solution:
I removed [Thycotic.PowerShell.Users.User] from the Get-TssUser module (see here) and then it works fine.

I'm not sure if this is a bug or not or that something is wrong with my Powershell instance, but either way there should be a fix.

What Edition of Secret Server?

Cloud Subscription

What version of Secret Server

Secret Server Cloud

What PowerShell host was used when producing this error

PowerShell Core (pwsh)

PowerShell Host Version

7

@deickhoff deickhoff added bug Something isn't working triage needed new issues that are still in state of triage labels Mar 5, 2024
@jagger
Copy link
Contributor

jagger commented Mar 5, 2024

@deickhoff please provide output examples for get-tssuser and update-tssuser with -verbose enabled per question 3

@deickhoff
Copy link
Author

deickhoff commented Mar 6, 2024

@jagger I updated the ticket. I didn't include the verbose because I had the idea that it was not useful. I also updated the error message so its complete!

@jagger jagger self-assigned this Mar 22, 2024
@jagger jagger added accepted bug or feature request accepted C# Class issue and removed triage needed new issues that are still in state of triage labels Mar 22, 2024
@jagger
Copy link
Contributor

jagger commented Mar 22, 2024

User class missing platformServiceUser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug or feature request accepted bug Something isn't working C# Class issue
Projects
None yet
Development

No branches or pull requests

2 participants