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

Search-TssFolderPermission not converting resulting PSCustomObject to Thycotic.PowerShell.FolderPermissions.Permission #383

Open
ciokthisout opened this issue Jan 4, 2024 · 1 comment · Fixed by #347
Labels
feature request New feature or request

Comments

@ciokthisout
Copy link

ciokthisout commented Jan 4, 2024

Verified issue does not already exist?

Yes

What error did you receive

Cannot convert value "@{id=566; folderId=118; groupId=6; groupName=; userId=6; userName=account;
folderAccessRoleId=10; folderAccessRoleName=Owner; secretAccessRoleId=11; secretAccessRoleName=Owner; knownAs=account; domainName=}" to type "Thycotic.PowerShell.FolderPermissions.Permission". Error: "Cannot convert the
"@{id=566; folderId=118; groupId=6; groupName=; userId=6; userName=account; folderAccessRoleId=10;
folderAccessRoleName=Owner; secretAccessRoleId=11; secretAccessRoleName=Owner; knownAs=account;
domainName=}" value of type "System.Management.Automation.PSCustomObject" to type
"Thycotic.PowerShell.FolderPermissions.Permission"."

Please run the command using -Verbose

Search-TssFolderPermission -TssSession $session -FolderId 118 -verbose
VERBOSE: Command invocation: Search-TssFolderPermission -TssSession:TssSessionObject -FolderId:TssSessionObject
-Verbose:True
VERBOSE: Filters: filter.folderId=22
VERBOSE: Performing the operation GET
https://org.secretservercloud.com/api/v1/folder-permissions?sortBy[0].direction=asc&sortBy[0].name=Id&take=2147483647&f
ilter.folderId=22
Cannot convert value "@{id=54; folderId=22; groupId=6; groupName=; userId=6; userName=account;
folderAccessRoleId=10; folderAccessRoleName=Owner; secretAccessRoleId=11; secretAccessRoleName=Owner; knownAs=account; domainName=}" to type "Thycotic.PowerShell.FolderPermissions.Permission". Error: "Cannot convert the
"@{id=54; folderId=22; groupId=6; groupName=; userId=6; userName=account; folderAccessRoleId=10;
folderAccessRoleName=Owner; secretAccessRoleId=11; secretAccessRoleName=Owner; knownAs=account;
domainName=}" value of type "System.Management.Automation.PSCustomObject" to type
"Thycotic.PowerShell.FolderPermissions.Permission"."
At C:\Program
Files\WindowsPowerShell\Modules\Thycotic.SecretServer\functions\folder-permissions\Search-TssFolderPermission.ps1:94
char:21

  • ... [Thycotic.PowerShell.FolderPermissions.Permission[]]$rest ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvalidCastConstructorException

Provide a test case or steps to reproduce

Search-TssFolderPermission -TssSession $session -FolderId 22

Expected behavior

When we had originally modified our script to perform this search (around May 2023), we were successfully getting the information back. At the time we were on v0.60.9. We tried updating to 61.0 and get the same result. Running the module on 61.1 and higher works fine, but requires PS 7+. We are triggering this script from a Secret Server pipeline and per Delinea support, invoking a script in PS 7 is not current supported from the UI. This is not a process we are going to run directly on an endpoint.

What Edition of Secret Server?

Platinum

What version of Secret Server

Secret Server Cloud

What PowerShell host was used when producing this error

Windows PowerShell (powershell)

PowerShell Host Version

5.1.20348.2110

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

jagger commented Jan 5, 2024

Issue is resolved on current release.

This is a request to return to powershell 5 compatibility so the module can be called from within secret server again.

@jagger jagger added feature request New feature or request and removed bug Something isn't working triage needed new issues that are still in state of triage labels Jan 5, 2024
@jagger jagger linked a pull request Jan 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants