PowerShell - Get-DSEntry does not returne on invalid GUID

PowerShell - Get-DSEntry does not returne on invalid GUID

avatar

When I run the command Get-DSEntry -All without passing the VaultID parameter I am asked for the VaultID as expected.

If I pass an empty string, or any other text which isn't a guid I keep getting prompted for the VaultID. I would expect the cmdlet to throw me an error and not keep asking indefinitely. Now I only have 2 options to get out of this loop:

  • Closing the terminal
  • Generate a GUID using the New-Guid cmdlet and passing this random GUID.


If I use the second option (passing the random GUID) I get an error not related to cmdlet, namely: Get-DSFolders: Unexpected exception

All Comments (4)

avatar

Hello @reinleen,

To stop the prompting loop, Ctrl+C should work.

I agree that this error isn't very descriptive; we'll look into it.

Best regards,
Christian

avatar

Ctrl + C works in pwsh indeed, but not in an IDE like VS Code (might also just be my configuration, but I don't have this issue with other cmdlets).

avatar

Hello @reinleen,

We weren't able to reproduce the prompt issue on our end; Ctrl+C behaved normally in VS Code as well as PowerShell. If the problem persists on your side, it may be environment-specific as you say. If you continue to run into this, feel free to share any additional details and we'll be happy to take another look.

Best regards,
Christian

avatar

Thanks for the clarification. Then it must be me with the Ctrl + C.

Still glad you will be looking into a more graceful return since Ctrl + C won't be a very useful solution to implement in a non-interactive script.