Skip to content

Commit c3b4d24

Browse files
committed
Should Process Cmdlets/NewAzureActiveDirectoryAppCmdlet.cs
1 parent 8c38ba0 commit c3b4d24

File tree

4 files changed

+70
-41
lines changed

4 files changed

+70
-41
lines changed

src/DataMigration/DataMigration/Cmdlets/NewAzureActiveDirectoryAppCmdlet.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Microsoft.Azure.Commands.DataMigration.Cmdlets
2121
/// <summary>
2222
/// Class that creates a new instance of AzureActiveDirectoryApp.
2323
/// </summary>
24-
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataMigrationAzureActiveDirectoryApp"), OutputType(typeof(PSAzureActiveDirectoryApp))]
24+
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataMigrationAzureActiveDirectoryApp", SupportsShouldProcess = true), OutputType(typeof(PSAzureActiveDirectoryApp))]
2525
[Alias("New-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DmsAadApp")]
2626
public class NewAzureActiveDirectoryAppCmdlet : DataMigrationCmdlet
2727
{
@@ -41,15 +41,18 @@ public class NewAzureActiveDirectoryAppCmdlet : DataMigrationCmdlet
4141

4242
public override void ExecuteCmdlet()
4343
{
44-
base.ExecuteCmdlet();
45-
46-
PSAzureActiveDirectoryApp aadApp = new PSAzureActiveDirectoryApp(this.DefaultContext.Tenant.Id)
44+
if (ShouldProcess(this.ApplicationId, Resources.createAadApp))
4745
{
48-
ApplicationId = ApplicationId,
49-
AppKey = AppKey,
50-
};
46+
base.ExecuteCmdlet();
47+
48+
PSAzureActiveDirectoryApp aadApp = new PSAzureActiveDirectoryApp(this.DefaultContext.Tenant.Id)
49+
{
50+
ApplicationId = ApplicationId,
51+
AppKey = AppKey,
52+
};
5153

52-
WriteObject(aadApp);
54+
WriteObject(aadApp);
55+
}
5356
}
5457
}
5558
}

src/DataMigration/DataMigration/DataMigration.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,18 @@
1515
<PackageReference Include="Microsoft.Azure.Management.DataMigration" Version="0.7.0-preview" />
1616
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
1717
</ItemGroup>
18+
<ItemGroup>
19+
<Compile Update="Resources.Designer.cs">
20+
<DesignTime>True</DesignTime>
21+
<AutoGen>True</AutoGen>
22+
<DependentUpon>Resources.resx</DependentUpon>
23+
</Compile>
24+
</ItemGroup>
25+
<ItemGroup>
26+
<EmbeddedResource Update="Resources.resx">
27+
<SubType>Designer</SubType>
28+
<Generator>ResXFileCodeGenerator</Generator>
29+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
30+
</EmbeddedResource>
31+
</ItemGroup>
1832
</Project>

src/DataMigration/DataMigration/Resources.Designer.cs

Lines changed: 42 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DataMigration/DataMigration/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,7 @@
207207
<data name="SKUDeprecationWarningMessage" xml:space="preserve">
208208
<value>The {0} SKU in service {1} is marked for deprecation and will be discontinued from 08/31/2018.</value>
209209
</data>
210+
<data name="createAadApp" xml:space="preserve">
211+
<value>Create Azure Active Directory App</value>
212+
</data>
210213
</root>

0 commit comments

Comments
 (0)