Hi. I wrote a single-line Powershell script, named test.ps1, which attempts to display the value of the CommonParameters errorAction:
"Error action is " + $errorAction
When I run this script, however, using the following command:
& .\Test.ps1 -errorAction ignore
I get the following output, without the errorAction value:
Error action is
Could you please tell me how to access CommonParameters values in a Powershell script? Do I need to handle them as I would any other parameter, such as explicitly defining errorAction as a parameter argument that the script accepts? Or is there a better way? Thank you.