Skip to content

EH PS Cmdlets #3251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 12, 2016
Merged

EH PS Cmdlets #3251

merged 18 commits into from
Dec 12, 2016

Conversation

v-Ajnava
Copy link

@v-Ajnava v-Ajnava commented Dec 6, 2016

Description


This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThrough parameter.

Cmdlet Parameter Guidelines

  • Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

Squashed commit of the following:

commit 5cf2ad3
Merge: 5f1336c 040141e
Author: REDMOND\v-ajnava <[email protected]>
Date:   Mon Dec 5 15:26:49 2016 -0800

    Merge branch 'dev' of https://github.com/Azure/azure-powershell into AJ_power_eh

commit 5f1336c
Author: Arun Dsouza <[email protected]>
Date:   Mon Dec 5 11:51:30 2016 -0800

    Updated with Wix file and EH only

commit a508e7b
Author: Arun Dsouza <[email protected]>
Date:   Mon Dec 5 10:38:08 2016 -0800

    wix updated

commit d3f8211
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 30 14:50:20 2016 -0800

    Resolved system.management.automation ref issue.

commit 24d2744
Author: REDMOND\v-ajnava <[email protected]>
Date:   Tue Nov 29 12:21:28 2016 -0800

    ServiceBus PS cmdlets

commit c4cd95f
Merge: 0001c62 1eb3f3b
Author: REDMOND\v-ajnava <[email protected]>
Date:   Sat Nov 26 13:57:28 2016 -0800

    Merge branch 'AJ_power1' of https://github.com/v-Ajnava/azure-powershell into AJ_power1

    # Conflicts:
    #	setup/azurecmdfiles.wxi
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/Commands.EventHubs.Test.csproj
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/ScenarioTests/NamespaceTests.ps1
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests/ConsumerGroupsCRUD.json
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsAuthorizationRulesCRUD.json
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsCRUD.json
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceAuthorizationRulesCRUD.json
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceCRUD.json

commit 0001c62
Author: REDMOND\v-ajnava <[email protected]>
Date:   Thu Nov 24 03:58:12 2016 -0800

    Review comments and WXI file

commit 1eb3f3b
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 23 11:09:35 2016 -0800

    WXI file

commit 15ce842
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 23 11:02:43 2016 -0800

    Review changes

commit 9c094fa
Author: REDMOND\sazeesha <[email protected]>
Date:   Fri Nov 18 18:32:15 2016 -0800

    New Session Records

commit 86816de
Author: REDMOND\sazeesha <[email protected]>
Date:   Fri Nov 18 14:27:33 2016 -0800

    Fix for build failure

commit acda882
Author: REDMOND\sazeesha <[email protected]>
Date:   Fri Nov 18 11:30:36 2016 -0800

    reference to test project

commit 046adb2
Author: REDMOND\sazeesha <[email protected]>
Date:   Thu Nov 17 17:34:27 2016 -0800

    Azure EventHub PS CmdLets

commit a6fad5a
Author: REDMOND\v-ajnava <[email protected]>
Date:   Thu Nov 17 17:26:41 2016 -0800

    removed the extra line from Test.Targets

commit 78914ad
Author: REDMOND\v-ajnava <[email protected]>
Date:   Thu Nov 17 17:11:15 2016 -0800

    added a reference to eventhub test project to Test.Targets

commit 1ca66a2
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 16 19:50:26 2016 -0800

    Added the set property

commit 9061a2c
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 16 17:19:17 2016 -0800

    Changes regarding the new object creation for New and Set cmdlets

commit 46cfcce
Author: REDMOND\v-ajnava <[email protected]>
Date:   Mon Nov 14 19:22:59 2016 -0800

    cleaned SetupManagementClients and added 'Hyak.Common' reference

commit 52aa0b4
Author: REDMOND\sazeesha <[email protected]>
Date:   Mon Nov 14 17:11:34 2016 -0800

    EventHub PS CmdLets
@azurecla
Copy link

azurecla commented Dec 6, 2016

Hi @v-Ajnava, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!


It looks like you're working at Microsoft (v-ajnava). If you're full-time, we DON'T require a contribution license agreement.



If you are a vendor, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;

@cormacpayne
Copy link
Member

cormacpayne commented Dec 6, 2016

@v-Ajnava Hey Ajit, last week we upgraded to ADAL 2.28.3, so you will need to update all instances of Microsoft.IdentityModel.Clients.ActiveDirectory to version 2.28.3.860

@markcowl
Copy link
Member

markcowl commented Dec 6, 2016

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this file

public override void ExecuteCmdlet()
{
// delete a ConsumerGroup
Client.DeletConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, ConsumerGroupName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to implement ShouldProcess

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved


[Parameter(Mandatory = false,
ValueFromPipelineByPropertyName = true,
ParameterSetName = EventHubParameterSetName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there two different parameter sets? If so, you need to attribute the commands appropriately, and you need to set the DefaultParameterSetName attribute for the cmndletr. Cmdlet attribute sets should differ by at least one required parameter,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there is single parameter set.


[Parameter(Mandatory = true,
ValueFromPipelineByPropertyName = true,
Position = 4,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many positional parameters, please keep this to 3-4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

public string AuthorizationRuleName { get; set; }

[Parameter(Mandatory = true,
Position = 4,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many positional parameters

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

public override void ExecuteCmdlet()
{
// Update a EventHub namespace
Dictionary<string, string> tagDictionary = TagsConversionHelper.CreateTagDictionary(Tag, validate: true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement SHouldProcess

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved


[Parameter(Mandatory = false,
ValueFromPipelineByPropertyName = true,
Position = 4,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many positional parameters

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shouyld not be set, this is not necessarily where these reside

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

<None Include="..\AzureRM.EventHub.psd1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="app.config" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

@@ -105,6 +113,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you adding these references to the common library? If you need them in your test assembly, add them there

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, Removed the references.

@@ -6,14 +6,17 @@
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.6179.26854-prerelease" targetFramework="net45" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment. DO not add dependencies here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, Removed the references.

sazeesha and others added 2 commits December 7, 2016 18:46
Squashed commit of the following:

commit 5cf2ad3
Merge: 5f1336c 040141e
Author: REDMOND\v-ajnava <[email protected]>
Date:   Mon Dec 5 15:26:49 2016 -0800

    Merge branch 'dev' of https://github.com/Azure/azure-powershell into AJ_power_eh

commit 5f1336c
Author: Arun Dsouza <[email protected]>
Date:   Mon Dec 5 11:51:30 2016 -0800

    Updated with Wix file and EH only

commit a508e7b
Author: Arun Dsouza <[email protected]>
Date:   Mon Dec 5 10:38:08 2016 -0800

    wix updated

commit d3f8211
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 30 14:50:20 2016 -0800

    Resolved system.management.automation ref issue.

commit 24d2744
Author: REDMOND\v-ajnava <[email protected]>
Date:   Tue Nov 29 12:21:28 2016 -0800

    ServiceBus PS cmdlets

commit c4cd95f
Merge: 0001c62 1eb3f3b
Author: REDMOND\v-ajnava <[email protected]>
Date:   Sat Nov 26 13:57:28 2016 -0800

    Merge branch 'AJ_power1' of https://github.com/v-Ajnava/azure-powershell into AJ_power1

    # Conflicts:
    #	setup/azurecmdfiles.wxi
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/Commands.EventHubs.Test.csproj
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/ScenarioTests/NamespaceTests.ps1
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.ConsumerGroupsTests/ConsumerGroupsCRUD.json
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsAuthorizationRulesCRUD.json
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.EventHubsTests/EventHubsCRUD.json
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceAuthorizationRulesCRUD.json
    #	src/ResourceManager/EventHub/Commands.EventHub.Test/SessionRecords/Microsoft.Azure.Commands.EventHub.Test.ScenarioTests.NamespaceTests/NamespaceCRUD.json

commit 0001c62
Author: REDMOND\v-ajnava <[email protected]>
Date:   Thu Nov 24 03:58:12 2016 -0800

    Review comments and WXI file

commit 1eb3f3b
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 23 11:09:35 2016 -0800

    WXI file

commit 15ce842
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 23 11:02:43 2016 -0800

    Review changes

commit 9c094fa
Author: REDMOND\sazeesha <[email protected]>
Date:   Fri Nov 18 18:32:15 2016 -0800

    New Session Records

commit 86816de
Author: REDMOND\sazeesha <[email protected]>
Date:   Fri Nov 18 14:27:33 2016 -0800

    Fix for build failure

commit acda882
Author: REDMOND\sazeesha <[email protected]>
Date:   Fri Nov 18 11:30:36 2016 -0800

    reference to test project

commit 046adb2
Author: REDMOND\sazeesha <[email protected]>
Date:   Thu Nov 17 17:34:27 2016 -0800

    Azure EventHub PS CmdLets

commit a6fad5a
Author: REDMOND\v-ajnava <[email protected]>
Date:   Thu Nov 17 17:26:41 2016 -0800

    removed the extra line from Test.Targets

commit 78914ad
Author: REDMOND\v-ajnava <[email protected]>
Date:   Thu Nov 17 17:11:15 2016 -0800

    added a reference to eventhub test project to Test.Targets

commit 1ca66a2
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 16 19:50:26 2016 -0800

    Added the set property

commit 9061a2c
Author: REDMOND\v-ajnava <[email protected]>
Date:   Wed Nov 16 17:19:17 2016 -0800

    Changes regarding the new object creation for New and Set cmdlets

commit 46cfcce
Author: REDMOND\v-ajnava <[email protected]>
Date:   Mon Nov 14 19:22:59 2016 -0800

    cleaned SetupManagementClients and added 'Hyak.Common' reference

commit 52aa0b4
Author: REDMOND\sazeesha <[email protected]>
Date:   Mon Nov 14 17:11:34 2016 -0800

    EventHub PS CmdLets
EventHub Cleanup and App.config fix

Microsoft.Rest.ClientRuntime.Azure.Authentication - 2.2.9 - preivew

Test project updated

Review comments resolved.

Removed the references from Common library.

```
git rebase -i HEAD~3
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks liek you need to rebase, there are far too many file changes in this

@markcowl
Copy link
Member

markcowl commented Dec 8, 2016

<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.1" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.2" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.2" targetFramework="net45" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will need to be updated to 3.3.4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.1" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.2" targetFramework="net45" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be updated to 2.3.4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.3\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.3.4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.2\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.3.4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.3" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.3" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.2" targetFramework="net45" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.3.4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.3" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.3" targetFramework="net45" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.3.4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved


[Parameter(Mandatory = true,
Position = 2,
ParameterSetName = SASRuleParameterSetName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not resolved. If you don't have more than one parameter set, then remove the ParameterSetName from this attribute. If you do have multiple parameter sets, then you need to attribute ther parameters for the parameter set they belong in, and you need to set 'DefaultParameterSetName' in the Cmdlet attribute

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved


[Parameter(Mandatory = true,
Position = 3,
ParameterSetName = RegenerateKeySetName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are not multiple parameter sets, then remove the ParameterSetName from this attribute. If there are multiople parameter sets, then you need to indicate the parameter set for each parameter and add the 'DefaultParameterSetName' setting to the Cmdlet attribute

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

@markcowl
Copy link
Member

markcowl commented Dec 9, 2016

@markcowl markcowl changed the base branch from dev to release-3.3.0 December 9, 2016 00:54
@cormacpayne
Copy link
Member

cormacpayne commented Dec 10, 2016

@cormacpayne cormacpayne merged commit c32739e into Azure:release-3.3.0 Dec 12, 2016
@v-Ajnava v-Ajnava deleted the Eh_power_3 branch April 12, 2018 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants