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
Operating System: N/A
VenafiPS version: 4.4.0
PowerShell version: All
TPP version (if applicable): All
Steps to reproduce
Pass ID for an AD based user or group into Get-VenafiTeam.
Expected behavior
The function should check passed ID belongs to a local Team before execution OR handle the resulting error internally.
Actual behavior
Function throws an error:
Get-VenafiTeam -ID 'AD+BigSur:594a960d633cfc40af1f1cf8d4241c37'
InvalidArgument: /Users/saad.humayun/Downloads/VenafiPS/VenafiPS/Public/Get-VenafiTeam.ps1:114
Line |
114 | $guid = [guid]($ID.Replace('local:', ''))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert value "AD+BigSur:594a960d633cfc40af1f1cf8d4241c37" to type "System.Guid". Error: "Guid should
| contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."
InvalidOperation: /Users/saad.humayun/Downloads/VenafiPS/VenafiPS/Public/Get-VenafiTeam.ps1:125
Line |
125 | … $params.UriLeaf = ('Teams/local/{{{0}}}' -f $guid.ToStrin …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
cmdlet Invoke-VenafiRestMethod at command pipeline position 1
Supply values for the following parameters:
UriLeaf:
More Info
The example provided uses AD group to deliberately cause the error. However, it can easily occur when calling Find-TppIdentity -Name 'Unix' | Get-VenafiTeam
if there is an AD group or User having name beginning with Unix.
Since all AD/LDAP based identities begin with AD or LDAP, you can use a regex to exclude them in the function. This should be a lot quicker than resolving the ID to check if it is indeed a team.
The text was updated successfully, but these errors were encountered:
Environment
Steps to reproduce
Pass ID for an AD based user or group into Get-VenafiTeam.
Expected behavior
The function should check passed ID belongs to a local Team before execution OR handle the resulting error internally.
Actual behavior
Function throws an error:
More Info
The example provided uses AD group to deliberately cause the error. However, it can easily occur when calling
Find-TppIdentity -Name 'Unix' | Get-VenafiTeam
if there is an AD group or User having name beginning with Unix.
Since all AD/LDAP based identities begin with AD or LDAP, you can use a regex to exclude them in the function. This should be a lot quicker than resolving the ID to check if it is indeed a team.
The text was updated successfully, but these errors were encountered: