File tree Expand file tree Collapse file tree 5 files changed +26
-4
lines changed
src/ResourceManager/MachineLearning/Commands.MachineLearning Expand file tree Collapse file tree 5 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ namespace Microsoft.Azure.Commands.MachineLearning.Cmdlets
27
27
WebServicesCmdletBase . CommandletSuffix ,
28
28
SupportsShouldProcess = true ) ]
29
29
[ OutputType ( typeof ( string ) ) ]
30
- public class ExportWebServiceDefinition : AzureRMCmdlet
30
+ public class ExportWebServiceDefinition : WebServicesCmdletBase
31
31
{
32
32
private const string ExportToFileParamSet = "Export to file." ;
33
33
private const string ExportToStringParamSet = "Export to JSON string." ;
@@ -60,7 +60,7 @@ public class ExportWebServiceDefinition : AzureRMCmdlet
60
60
HelpMessage = "Do not ask for confirmation." ) ]
61
61
public SwitchParameter Force { get ; set ; }
62
62
63
- public override void ExecuteCmdlet ( )
63
+ protected override void RunCmdlet ( )
64
64
{
65
65
string serializedDefinition =
66
66
ModelsSerializationUtil . GetAzureMLWebServiceDefinitionJsonFromObject ( this . WebService ) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.MachineLearning.Cmdlets
23
23
{
24
24
[ Cmdlet ( VerbsData . Import , WebServicesCmdletBase . CommandletSuffix ) ]
25
25
[ OutputType ( typeof ( WebService ) ) ]
26
- public class ImportWebServiceDefinition : AzureRMCmdlet
26
+ public class ImportWebServiceDefinition : WebServicesCmdletBase
27
27
{
28
28
private const string ImportFromFileParamSet = "Import from JSON file." ;
29
29
private const string ImportFromStringParamSet = "Import from JSON string." ;
@@ -42,7 +42,7 @@ public class ImportWebServiceDefinition : AzureRMCmdlet
42
42
[ ValidateNotNullOrEmpty ]
43
43
public string JsonString { get ; set ; }
44
44
45
- public override void ExecuteCmdlet ( )
45
+ protected override void RunCmdlet ( )
46
46
{
47
47
string jsonDefinition = this . JsonString ;
48
48
if ( string . Equals (
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ protected override void BeginProcessing()
82
82
}
83
83
catch ( Exception ex )
84
84
{
85
+ this . WriteVersionInfoToDebugChannel ( ) ;
85
86
if ( this . IsFatalException ( ex ) )
86
87
{
87
88
ThrowTerminatingError (
@@ -105,6 +106,7 @@ protected override void EndProcessing()
105
106
}
106
107
catch ( Exception ex )
107
108
{
109
+ this . WriteVersionInfoToDebugChannel ( ) ;
108
110
if ( this . IsFatalException ( ex ) )
109
111
{
110
112
ThrowTerminatingError (
@@ -138,6 +140,7 @@ protected override void StopProcessing()
138
140
}
139
141
catch ( Exception ex )
140
142
{
143
+ this . WriteVersionInfoToDebugChannel ( ) ;
141
144
if ( this . IsFatalException ( ex ) )
142
145
{
143
146
throw ;
@@ -169,6 +172,8 @@ public override void ExecuteCmdlet()
169
172
}
170
173
catch ( Exception ex )
171
174
{
175
+ this . WriteVersionInfoToDebugChannel ( ) ;
176
+
172
177
if ( this . IsFatalException ( ex ) )
173
178
{
174
179
throw ;
@@ -329,5 +334,10 @@ ex is SecurityException ||
329
334
ex is SEHException ;
330
335
}
331
336
337
+ private void WriteVersionInfoToDebugChannel ( )
338
+ {
339
+ var versionInfo = this . MyInvocation . MyCommand . Module . Version ;
340
+ this . WriteDebug ( Resources . VersionInfo . FormatInvariant ( versionInfo . ToString ( 3 ) ) ) ;
341
+ }
332
342
}
333
343
}
Original file line number Diff line number Diff line change 135
135
<data name =" UpdateServiceWarning" xml : space =" preserve" >
136
136
<value >Are you sure you want to update the machine learning web service "{0}" ?</value >
137
137
</data >
138
+ <data name =" VersionInfo" xml : space =" preserve" >
139
+ <value >Azure Machine Learning Module Version: "{0}"</value >
140
+ </data >
138
141
</root >
You can’t perform that action at this time.
0 commit comments