powershellwrapper icon indicating copy to clipboard operation
powershellwrapper copied to clipboard

web_error return variable is not valid

Open DarrenWhite99 opened this issue 6 years ago • 0 comments

Steps to reproduce Call any function that returns an error. Example: Get-ITGlueConfigurations -id 12345

Expected behavior

The variable $web_error should contain the error output.

Actual behavior

$web_error is not returned. This is because the -ErrorVariable parameter expects the bare name for the variable, without the $. Example: -ErrorVariable web_error

Assuming that the intent is to allow users to define their own variable name, where $web_error='my_error_variable', it should be called as: -ErrorVariable $($web_error) which would put the error output into $my_error_variable

I think using $web_error as the return variable is fine, but perhaps the other behavior would be desired.

DarrenWhite99 avatar Jan 30 '19 02:01 DarrenWhite99