Skip to content

Get-TssGroupUser: -UserId is mandatory but should be optional to list all users in a group #434

Description

@jagger

Description

Get-TssGroupUser has both -Id (GroupId) and -UserId as mandatory parameters. The function name implies it retrieves the users belonging to a group, so -UserId should be optional (to allow retrieving all users) or the function should be renamed to make clear it only checks a specific user'''s membership.

Error

Cannot process command because of one or more missing mandatory parameters: UserId.

Repro

$session = New-TssSession -SecretServer https://labss01.jaggerlab.local/ -Credential $cred
$group   = Search-TssGroup -TssSession $session | Select-Object -First 1
Get-TssGroupUser -TssSession $session -Id $group.Id
# ^ Fails: UserId is mandatory

Expected

Should return all users belonging to the specified group (like Get-TssGroupMember).

Environment

  • Module version: 0.62.0 (dev branch)
  • Secret Server version: 12.0.000022
  • PowerShell: 7.x

Notes

Get-TssGroupMember works correctly with just a GroupId. If Get-TssGroupUser is intended only for membership checks on a specific user, consider renaming it to Test-TssGroupUser or Get-TssGroupMembership and documenting the distinction clearly.

Metadata

Metadata

Assignees

Labels

acceptedbug or feature request accepted

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions