Finding out which Switch option is currently active

Since the variable is used only to decide in the switch statement, it will not be exposed.
I think naming the variable specific and making it global will help as the global variable will be accessible across the session till it ends.
at the end of the function you can set a global variable like below

$Global:PromptSyle=$Action

Then this variable should be present across the session.

2 Likes