@@ -136,21 +136,39 @@ protected override void EndProcessing()
136
136
this . command . CurrentSubscription = this . GetCurrentSubscription ( this . Subscription , this . Certificate ) ;
137
137
this . AssertTaskLogsDirectorySpecified ( this . TaskLogsDirectory ) ;
138
138
139
- if ( this . StandardError . IsPresent )
139
+ int numSpecifiedOutputTypes = 0 ;
140
+ string selectedOutputType = "Standard Output" ;
141
+ this . command . OutputType = JobOutputType . StandardOutput ;
142
+
143
+ if ( this . StandardOutput . IsPresent )
140
144
{
141
- this . command . OutputType = JobOutputType . StandardError ;
145
+ numSpecifiedOutputTypes ++ ;
142
146
}
143
- else if ( this . TaskSummary . IsPresent )
147
+
148
+ if ( this . DownloadTaskLogs . IsPresent )
149
+ {
150
+ this . command . OutputType = JobOutputType . TaskLogs ;
151
+ selectedOutputType = "Task Logs" ;
152
+ numSpecifiedOutputTypes ++ ;
153
+ }
154
+
155
+ if ( this . TaskSummary . IsPresent )
144
156
{
145
157
this . command . OutputType = JobOutputType . TaskSummary ;
158
+ selectedOutputType = "Task Summary" ;
159
+ numSpecifiedOutputTypes ++ ;
146
160
}
147
- else if ( this . DownloadTaskLogs . IsPresent )
161
+
162
+ if ( this . StandardError . IsPresent )
148
163
{
149
- this . command . OutputType = JobOutputType . TaskLogs ;
164
+ this . command . OutputType = JobOutputType . StandardError ;
165
+ selectedOutputType = "Standard Error" ;
166
+ numSpecifiedOutputTypes ++ ;
150
167
}
151
- else
168
+
169
+ if ( numSpecifiedOutputTypes > 1 )
152
170
{
153
- this . command . OutputType = JobOutputType . StandardOutput ;
171
+ this . WriteWarning ( String . Format ( "This cmdlet supports specifying only one job output type. Only {0} will be returned" , selectedOutputType ) ) ;
154
172
}
155
173
156
174
try
0 commit comments