G-CLI icon indicating copy to clipboard operation
G-CLI copied to clipboard

Better Powershell Integration

Open JamesWiresmith opened this issue 2 years ago • 0 comments

Getting errors to powershell is a pain. It doesn't report an error based on return code and by default doesn't error if stderr contains data (I thought this would fix this).

This is one of the most common issues that comes up.

We aren't the only people with this issue. For example this guide from octopus deploy lays out the options: https://octopus.com/docs/deployments/custom-scripts/error-handling

This is a placeholder for if anyone can recommend a way to better integrate with powershell for this to work. I'm guessing there are two options:

  • Native app has a way to throw in powershell - I haven't seen that.
  • Create a cmdlet that wraps G-CLI and checks the return code and/or error stream.

I suspect the cmdlet is the better way to go. There is a tool called "Crescendo" which is designed to help with this: https://www.youtube.com/watch?v=c9m7ZdSwgkQ. Probably a better overview is https://devblogs.microsoft.com/powershell/native-commands-in-powershell-a-new-approach/

JamesWiresmith avatar Jul 04 '23 14:07 JamesWiresmith