Skip to content

Write current module version to Verbose channel. #2810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 30, 2016

Conversation

NonStatic2014
Copy link
Contributor

Sometimes, our customer may use an old version of AzureML PS cmdlet and cause unexpected result. We have to let them know how to use other PowerShell cmdlet to get the module number. With this change, they just need to add -vb in the same command line and then they can easily get it and help the investigation.

@markcowl
Copy link
Member

@NonStatic2014 This is not recommended practice for finding the module version. If you would prefer to make this part of exception handling, or include the module version int he debug stream, this would be preferable.

@NonStatic2014
Copy link
Contributor Author

@markcowl I tried to write it into Debug channel, but it will require user do the rest of work step by step, or setup an environment variable before run the command. I'd like to use the Verbose channel to make the user experience easier for them other more commands or action.

@markcowl
Copy link
Member

@NonStatic2014 The assembly version is not useful information in this case, you want the module version. Please change this to be the module version, and please put this in exception handling code and in the debug stream.

@@ -138,6 +140,7 @@ protected override void StopProcessing()
}
catch (Exception ex)
{
this.WriteVersionInfoToDebugChannel();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking more of adding this information to the error itself, but you could do this in a subsequent PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that will be a bigger change: derive from ErrorRecord, put the module version in it and return that object. Let me do that when we have more information needs to be displayed during exception handling.

@markcowl
Copy link
Member

ON demand run here: http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1124/

LGTM once the on-demand run passes.

@cormacpayne cormacpayne merged commit 0937684 into Azure:dev Aug 30, 2016
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.

4 participants