Skip to content

Commit 50943fc

Browse files
committed
Fixed Tags & added AsJob
1 parent bd42d6f commit 50943fc

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/ResourceManager/Sql/Commands.Sql/JobAgent/Cmdlet/NewAzureSqlJobAgent.cs

+11-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System.Collections;
1516
using System.Collections.Generic;
1617
using System.Linq;
1718
using System.Management.Automation;
19+
using Microsoft.Azure.Commands.ResourceManager.Common.Tags;
1820
using Microsoft.Rest.Azure;
1921

2022
namespace Microsoft.Azure.Commands.Sql.JobAgent.Cmdlet
@@ -57,7 +59,14 @@ public class NewAzureSqlJobAgent : AzureSqlJobAgentCmdletBase
5759
/// </summary>
5860
[Parameter(Mandatory = false,
5961
HelpMessage = "The tags to associate with the Azure Sql Job Account")]
60-
public Dictionary<string, string> Tags { get; set; }
62+
[Alias("Tag")]
63+
public Hashtable Tags { get; set; }
64+
65+
/// <summary>
66+
/// Gets or sets whether or not to run this cmdlet in the background as a job
67+
/// </summary>
68+
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
69+
public SwitchParameter AsJob { get; set; }
6170

6271
/// <summary>
6372
/// Check to see if the job account already exists in this resource group.
@@ -106,7 +115,7 @@ public class NewAzureSqlJobAgent : AzureSqlJobAgentCmdletBase
106115
ServerName = this.ServerName,
107116
JobAgentName = this.JobAgentName,
108117
DatabaseName = this.DatabaseName,
109-
Tags = this.Tags
118+
Tags = TagsConversionHelper.CreateTagDictionary(Tags, validate: true),
110119
}
111120
};
112121
return newEntity;

src/ResourceManager/Sql/Commands.Sql/JobAgent/Cmdlet/RemoveAzureSqlJobAgent.cs

+6
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ public class RemoveAzureSqlJobAgent : AzureSqlJobAgentCmdletBase
5050
[Parameter(HelpMessage = "Skip confirmation message for performing the action")]
5151
public SwitchParameter Force { get; set; }
5252

53+
/// <summary>
54+
/// Gets or sets whether or not to run this cmdlet in the background as a job
55+
/// </summary>
56+
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
57+
public SwitchParameter AsJob { get; set; }
58+
5359
/// <summary>
5460
/// Gets the entity to delete
5561
/// </summary>

0 commit comments

Comments
 (0)