|
19 | 19 |
|
20 | 20 | namespace Microsoft.Azure.Commands.Batch
|
21 | 21 | {
|
22 |
| - [Cmdlet(VerbsCommon.New, Constants.AzureRmBatchApplicationPackage), OutputType(typeof(PSApplicationPackage))] |
| 22 | + [Cmdlet(VerbsCommon.New, Constants.AzureRmBatchApplicationPackage, DefaultParameterSetName = UploadAndActivateSet), OutputType(typeof(PSApplicationPackage))] |
23 | 23 | public class NewBatchApplicationPackageCommand : BatchCmdletBase
|
24 | 24 | {
|
25 |
| - [Parameter(Position = 0, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the name of the Batch account.")] |
| 25 | + internal const string ActivateOnlySet = "ActivateOnly"; |
| 26 | + internal const string UploadAndActivateSet = "UpdateAndActivate"; |
| 27 | + |
| 28 | + [Parameter(Position = 0, ParameterSetName = UploadAndActivateSet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the name of the Batch account.")] |
| 29 | + [Parameter(Position = 0, ParameterSetName = ActivateOnlySet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the name of the Batch account.")] |
26 | 30 | [ValidateNotNullOrEmpty]
|
27 | 31 | public string AccountName { get; set; }
|
28 | 32 |
|
29 |
| - [Parameter(Position = 1, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the name of the resource group that contains the Batch account.")] |
| 33 | + [Parameter(Position = 1, ParameterSetName = UploadAndActivateSet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the name of the resource group that contains the Batch account.")] |
| 34 | + [Parameter(Position = 1, ParameterSetName = ActivateOnlySet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the name of the resource group that contains the Batch account.")] |
30 | 35 | [ValidateNotNullOrEmpty]
|
31 | 36 | public string ResourceGroupName { get; set; }
|
32 | 37 |
|
33 |
| - [Parameter(Position = 2, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the id of the application.")] |
| 38 | + [Parameter(Position = 2, ParameterSetName = UploadAndActivateSet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the id of the application.")] |
| 39 | + [Parameter(Position = 2, ParameterSetName = ActivateOnlySet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the id of the application.")] |
34 | 40 | [ValidateNotNullOrEmpty]
|
35 | 41 | public string ApplicationId { get; set; }
|
36 | 42 |
|
37 |
| - [Parameter(Position = 3, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the version of the application.")] |
| 43 | + [Parameter(Position = 3, ParameterSetName = UploadAndActivateSet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the version of the application.")] |
| 44 | + [Parameter(Position = 3, ParameterSetName = ActivateOnlySet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the version of the application.")] |
38 | 45 | [ValidateNotNullOrEmpty]
|
39 | 46 | public string ApplicationVersion { get; set; }
|
40 | 47 |
|
41 |
| - [Parameter(Position = 4, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the file to be uploaded as the application package binary file.")] |
| 48 | + [Parameter(Position = 4, ParameterSetName = UploadAndActivateSet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the format of the application package binary file.")] |
| 49 | + [Parameter(Position = 4, ParameterSetName = ActivateOnlySet, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the format of the application package binary file.")] |
42 | 50 | [ValidateNotNullOrEmpty]
|
43 |
| - public string FilePath { get; set; } |
| 51 | + public string Format { get; set; } |
44 | 52 |
|
45 |
| - [Parameter(Position = 5, ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = "Specifies the format of the application package binary file.")] |
| 53 | + [Parameter(ValueFromPipelineByPropertyName = true, ParameterSetName = UploadAndActivateSet, Mandatory = true, HelpMessage = "Specifies the file path of the application that will be uploaded to Azure Storage.")] |
46 | 54 | [ValidateNotNullOrEmpty]
|
47 |
| - public string Format { get; set; } |
| 55 | + public string FilePath { get; set; } |
48 | 56 |
|
49 |
| - [Parameter(Position = 6, ValueFromPipelineByPropertyName = true)] |
| 57 | + [Parameter(ValueFromPipelineByPropertyName = true, ParameterSetName = ActivateOnlySet)] |
50 | 58 | [ValidateNotNullOrEmpty]
|
51 | 59 | public SwitchParameter ActivateOnly { get; set; }
|
52 | 60 |
|
|
0 commit comments