Skip to content

Output script name and args for debugging purposes#569

Merged
weshaggard merged 1 commit into
Azure:masterfrom
weshaggard:OutputScriptArgs
May 5, 2020
Merged

Output script name and args for debugging purposes#569
weshaggard merged 1 commit into
Azure:masterfrom
weshaggard:OutputScriptArgs

Conversation

@weshaggard

Copy link
Copy Markdown
Member

Try #2 as the first attempt #481 didn't work in all cases. In particular it doesn't work when you invoke the powershell script across multiple lines as $myInvocation.Line only gives you the first line of context. Why? I have no idea but this new approach seems to work from my limited testing. I guess time will tell if there are any other weird issues.

cc @Azure/azure-sdk-eng

@weshaggard weshaggard requested a review from a team as a code owner May 5, 2020 22:51
@weshaggard weshaggard merged commit e157cfa into Azure:master May 5, 2020
@weshaggard

Copy link
Copy Markdown
Member Author

As FYI I just found out that this solution will not work either as $args only includes unbound arguments and if a parameter is bound then it will not be shown which is going to be the case for most of our script usages. I've filed an issue with powershell at PowerShell/PowerShell#12609 and once I get more information from that I will update our scripts again with some recommended approach.

@weshaggard weshaggard deleted the OutputScriptArgs branch September 6, 2020 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants