diff --git a/AzurePowershell.Test.targets b/AzurePowershell.Test.targets index 934eb39a61c1..ab6484c15da1 100644 --- a/AzurePowershell.Test.targets +++ b/AzurePowershell.Test.targets @@ -50,8 +50,8 @@ Command="MSTest.exe /testcontainer:$(_testAssembly) /testsettings:$(_testSettings) /category:$(_testFilter) /resultsfile:$(_testResult)" ContinueOnError="false" /> - - + + @@ -62,7 +62,7 @@ - + @@ -85,10 +85,12 @@ - + - + + + - + @@ -37,11 +42,14 @@ $(PublishDirectory)\TestResults true http://psget/PSGallery/api/v2/ + all - - - + + + @@ -77,7 +85,7 @@ Targets="Clean" Properties="Configuration=$(Configuration);Platform=Any CPU" ContinueOnError="false" - Condition=" '$(Scope)' == '' "/> + Condition=" '$(Scope)' == 'all' "/> @@ -159,17 +167,17 @@ Targets="Build" Properties="Configuration=$(Configuration);Platform=Any CPU" ContinueOnError="false" - Condition=" '$(Scope)' == '' "/> + Condition=" '$(Scope)' == 'all' "/> + Condition=" '$(Scope)' == 'all' "/> + Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" /> @@ -289,11 +297,10 @@ - + - - + diff --git a/src/ResourceManager/ApiManagement/ApiManagement.sln b/src/ResourceManager/ApiManagement/ApiManagement.sln index 509ae32588a3..733aa0b7732b 100644 --- a/src/ResourceManager/ApiManagement/ApiManagement.sln +++ b/src/ResourceManager/ApiManagement/ApiManagement.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +VisualStudioVersion = 12.0.40629.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}" EndProject @@ -32,6 +32,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -94,6 +96,10 @@ Global {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Automation/Automation.sln b/src/ResourceManager/Automation/Automation.sln index 6ead0ee365f3..9376fc4f5b00 100644 --- a/src/ResourceManager/Automation/Automation.sln +++ b/src/ResourceManager/Automation/Automation.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Prof EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.ResourceManager.Common", "..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj", "{3436A126-EDC9-4060-8952-9A1BE34CDD95}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.Build.0 = Debug|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.ActiveCfg = Release|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/AzureBackup/AzureBackup.sln b/src/ResourceManager/AzureBackup/AzureBackup.sln index f51f6f155112..287471331331 100644 --- a/src/ResourceManager/AzureBackup/AzureBackup.sln +++ b/src/ResourceManager/AzureBackup/AzureBackup.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/AzureBatch/AzureBatch.sln b/src/ResourceManager/AzureBatch/AzureBatch.sln index 9c364d137071..344a94efde20 100644 --- a/src/ResourceManager/AzureBatch/AzureBatch.sln +++ b/src/ResourceManager/AzureBatch/AzureBatch.sln @@ -18,6 +18,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources", "..\Re EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", "..\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.csproj", "{8058D403-06E3-4BED-8924-D166CE303961}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -52,6 +56,14 @@ Global {8058D403-06E3-4BED-8924-D166CE303961}.Debug|Any CPU.Build.0 = Debug|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.ActiveCfg = Release|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Compute/Compute.sln b/src/ResourceManager/Compute/Compute.sln index 11bb5e5e40b6..4675b38ccd59 100644 --- a/src/ResourceManager/Compute/Compute.sln +++ b/src/ResourceManager/Compute/Compute.sln @@ -34,6 +34,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Storage", "..\..\Common\Storage\Commands.Storage\Commands.Storage.csproj", "{08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -100,6 +102,10 @@ Global {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Debug|Any CPU.Build.0 = Debug|Any CPU {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Release|Any CPU.ActiveCfg = Release|Any CPU {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Release|Any CPU.Build.0 = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/DataFactories/DataFactories.sln b/src/ResourceManager/DataFactories/DataFactories.sln index 5c206b6c79a6..776515232269 100644 --- a/src/ResourceManager/DataFactories/DataFactories.sln +++ b/src/ResourceManager/DataFactories/DataFactories.sln @@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources", "..\Re EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", "..\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.csproj", "{8058D403-06E3-4BED-8924-D166CE303961}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -64,6 +66,10 @@ Global {8058D403-06E3-4BED-8924-D166CE303961}.Debug|Any CPU.Build.0 = Debug|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.ActiveCfg = Release|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.Build.0 = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Dns/Dns.sln b/src/ResourceManager/Dns/Dns.sln index b9a2ce6145e8..51bb234e88d0 100644 --- a/src/ResourceManager/Dns/Dns.sln +++ b/src/ResourceManager/Dns/Dns.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Dns.Test", "Commands.Dns.Test\Commands.Dns.Test.csproj", "{133561EC-99AF-4ADC-AF41-39C4D3AD323B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {133561EC-99AF-4ADC-AF41-39C4D3AD323B}.Debug|Any CPU.Build.0 = Debug|Any CPU {133561EC-99AF-4ADC-AF41-39C4D3AD323B}.Release|Any CPU.ActiveCfg = Release|Any CPU {133561EC-99AF-4ADC-AF41-39C4D3AD323B}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/HDInsight/HDInsight.sln b/src/ResourceManager/HDInsight/HDInsight.sln index 242437eea50a..b014fe0664c9 100644 --- a/src/ResourceManager/HDInsight/HDInsight.sln +++ b/src/ResourceManager/HDInsight/HDInsight.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Insights/Insights.sln b/src/ResourceManager/Insights/Insights.sln index 14804839b33f..36d29f50e21d 100644 --- a/src/ResourceManager/Insights/Insights.sln +++ b/src/ResourceManager/Insights/Insights.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/KeyVault/KeyVault.sln b/src/ResourceManager/KeyVault/KeyVault.sln index 312a9f3fe52c..d0026ceedd50 100644 --- a/src/ResourceManager/KeyVault/KeyVault.sln +++ b/src/ResourceManager/KeyVault/KeyVault.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Network/Network.sln b/src/ResourceManager/Network/Network.sln index c351f2c5f7fb..828d39e9f320 100644 --- a/src/ResourceManager/Network/Network.sln +++ b/src/ResourceManager/Network/Network.sln @@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -64,6 +66,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/OperationalInsights/OperationalInsights.sln b/src/ResourceManager/OperationalInsights/OperationalInsights.sln index 6e6226bf7a44..627df9cc0c04 100644 --- a/src/ResourceManager/OperationalInsights/OperationalInsights.sln +++ b/src/ResourceManager/OperationalInsights/OperationalInsights.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Profile/Profile.sln b/src/ResourceManager/Profile/Profile.sln index 0689f47ced3b..eeb568975b82 100644 --- a/src/ResourceManager/Profile/Profile.sln +++ b/src/ResourceManager/Profile/Profile.sln @@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile.Test", "Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.ResourceManager.Common", "..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj", "{3436A126-EDC9-4060-8952-9A1BE34CDD95}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -34,6 +36,10 @@ Global {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.Build.0 = Debug|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.ActiveCfg = Release|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs index 8fd5f15be630..a9e7402532d9 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs @@ -47,5 +47,12 @@ public void TestSetRedisCacheBugFixTest() { RunPowerShellTest("Test-SetRedisCacheBugFixTest"); } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestMaxMemoryPolicyErrorCheck() + { + RunPowerShellTest("Test-MaxMemoryPolicyErrorCheck"); + } } } diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 index ea4bdc4dcf75..7ee5023a6878 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 @@ -258,4 +258,20 @@ function Test-SetRedisCacheBugFixTest $cacheUpdated2 = Set-AzureRmRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} Assert-AreEqual "allkeys-lru" $cacheUpdated2.RedisConfiguration.Item("maxmemory-policy") Assert-True { $cacheUpdated2.EnableNonSslPort } +} + +<# +.SYNOPSIS +Tests MaxMemoryPolicy error check +#> +function Test-MaxMemoryPolicyErrorCheck +{ + # Setup + # resource group should exists + $resourceGroupName = "DummyResourceGroup" + $cacheName = "dummycache" + $location = "North Central US" + + # Updating Cache + Assert-ThrowsContains {New-AzureRMRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -MaxMemoryPolicy AllKeysRandom} "The 'MaxMemoryPolicy' setting has been deprecated" } \ No newline at end of file diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs index cca419c5d864..c852ea18269b 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs @@ -22,6 +22,7 @@ namespace Microsoft.Azure.Commands.RedisCache using SkuStrings = Microsoft.Azure.Management.Redis.Models.SkuName; using Hyak.Common; using System.Collections; + using System; [Cmdlet(VerbsCommon.New, "AzureRmRedisCache"), OutputType(typeof(RedisCacheAttributesWithAccessKeys))] public class NewAzureRedisCache : RedisCacheCmdletBase @@ -50,6 +51,9 @@ public class NewAzureRedisCache : RedisCacheCmdletBase [ValidateSet(SkuStrings.Basic, SkuStrings.Standard, IgnoreCase = false)] public string Sku { get; set; } + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "MaxMemoryPolicy is deprecated. Please use RedisConfiguration instead.")] + public string MaxMemoryPolicy { get; set; } + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "A hash table which represents redis configuration properties.")] public Hashtable RedisConfiguration { get; set; } @@ -65,6 +69,11 @@ protected override void ProcessRecord() WriteWarning("The RedisVersion parameter has been deprecated. As such, it is no longer necessary to provide this parameter and any value specified is ignored."); } + if (!string.IsNullOrEmpty(MaxMemoryPolicy)) + { + throw new ArgumentException(Resources.MaxMemoryPolicyException); + } + string skuFamily; int skuCapacity = 1; diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs index f4d1e2f84fd8..a73e8f0d58e7 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs @@ -15,11 +15,14 @@ namespace Microsoft.Azure.Commands.RedisCache { using Microsoft.Azure.Commands.RedisCache.Models; + using Microsoft.Azure.Commands.RedisCache.Properties; using Microsoft.Azure.Management.Redis.Models; using System.Collections; using System.Management.Automation; using SkuStrings = Microsoft.Azure.Management.Redis.Models.SkuName; - + using Hyak.Common; + using System; + [Cmdlet(VerbsCommon.Set, "AzureRmRedisCache", DefaultParameterSetName = MaxMemoryParameterSetName), OutputType(typeof(RedisCacheAttributesWithAccessKeys))] public class SetAzureRedisCache : RedisCacheCmdletBase { @@ -42,6 +45,9 @@ public class SetAzureRedisCache : RedisCacheCmdletBase [ValidateSet(SkuStrings.Basic, SkuStrings.Standard, IgnoreCase = false)] public string Sku { get; set; } + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "MaxMemoryPolicy is deprecated. Please use RedisConfiguration instead.")] + public string MaxMemoryPolicy { get; set; } + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "A hash table which represents redis configuration properties.")] public Hashtable RedisConfiguration { get; set; } @@ -50,6 +56,11 @@ public class SetAzureRedisCache : RedisCacheCmdletBase protected override void ProcessRecord() { + if (!string.IsNullOrEmpty(MaxMemoryPolicy)) + { + throw new ArgumentException(Resources.MaxMemoryPolicyException); + } + RedisGetResponse response = CacheClient.GetCache(ResourceGroupName, Name); string skuName; diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml b/src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml index 7d0a776fdbee..65154c2edc2f 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml @@ -316,6 +316,13 @@ String + + MaxMemoryPolicy + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + + String + RedisConfiguration @@ -408,6 +415,18 @@ Standard + + MaxMemoryPolicy + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + + String + + String + + + + RedisConfiguration @@ -1088,6 +1107,13 @@ String + + MaxMemoryPolicy + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + + String + RedisConfiguration @@ -1155,6 +1181,18 @@ + + MaxMemoryPolicy + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + + String + + String + + + + RedisConfiguration diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs index 504ce90ddea9..dd9cdd59e67b 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"}. + /// + internal static string MaxMemoryPolicyException { + get { + return ResourceManager.GetString("MaxMemoryPolicyException", resourceCulture); + } + } + /// /// Looks up a localized string similar to Redis cache with name '{0}' already exists.. /// diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.resx b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.resx index 9535144c625c..e5ab2b9bd9d6 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.resx +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + Redis cache with name '{0}' already exists. diff --git a/src/ResourceManager/RedisCache/RedisCache.sln b/src/ResourceManager/RedisCache/RedisCache.sln index c1a0b9ceea01..0f8569262a39 100644 --- a/src/ResourceManager/RedisCache/RedisCache.sln +++ b/src/ResourceManager/RedisCache/RedisCache.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Prof EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.ResourceManager.Common", "..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj", "{3436A126-EDC9-4060-8952-9A1BE34CDD95}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.Build.0 = Debug|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.ActiveCfg = Release|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.csproj b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.csproj index f16b165c9807..5b002cf6738b 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.csproj +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.csproj @@ -120,6 +120,7 @@ + diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs index dbe87b7521d0..777e0354038a 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs @@ -47,6 +47,13 @@ public class Resource [JsonProperty(Required = Required.Default)] public string Type { get; set; } + /// + /// Gets or sets the resource sku. + /// + [JsonProperty(Required = Required.Default)] + public ResourceSku Sku { get; set; } + + /// /// Gets or sets the kind of the resource definition. /// diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/ResourceSku.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/ResourceSku.cs new file mode 100644 index 000000000000..ae79227e562d --- /dev/null +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/ResourceSku.cs @@ -0,0 +1,55 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.Resources +{ + using Newtonsoft.Json; + + /// + /// The resource sku object. + /// + public class ResourceSku + { + /// + /// Gets or sets the sku name. + /// + [JsonProperty(Required = Required.Always)] + public string Name { get; set; } + + /// + /// Gets or sets the sku tier. + /// + [JsonProperty(Required = Required.Default)] + public string Tier { get; set; } + + /// + /// Gets or sets the sku size. + /// + [JsonProperty(Required = Required.Default)] + public string Size { get; set; } + + /// + /// Gets or sets the sku family. + /// + [JsonProperty(Required = Required.Default)] + public string Family { get; set; } + + /// + /// Gets or sets the sku capacity. + /// + [JsonProperty(Required = Required.Default)] + public int? Capacity { get; set; } + } +} + diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs index 1f858d190f69..4bc018559ad3 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs @@ -76,7 +76,7 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase /// Gets or sets the resource name parameter. /// [Alias("Id")] - [Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceByIdParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource's Id.")] + [Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceByIdParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource's Id.")] [ValidateNotNullOrEmpty] public string ResourceId { get; set; } diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs index e8ee28eb24d0..7ea4243ee2a1 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs @@ -30,12 +30,12 @@ public class GetAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("ExtensionResourceName")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] [ValidateNotNullOrEmpty] public string LockName { get; set; } diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs index 20ae91629c14..ab8ce0bf43c1 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs @@ -60,6 +60,14 @@ public sealed class NewAzureResourceCmdlet : ResourceManipulationCmdletBase [ValidateNotNullOrEmpty] public Hashtable PlanObject { get; set; } + /// + /// Gets or sets the plan object. + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents sku properties.")] + [ValidateNotNullOrEmpty] + public Hashtable SkuObject { get; set; } + + /// /// Gets or sets the tags. /// @@ -174,6 +182,7 @@ private Resource GetResource() Location = this.Location, Kind = this.Kind, Plan = this.PlanObject.ToDictionary(addValueLayer: false).ToJson().FromJson(), + Sku = this.SkuObject.ToDictionary(addValueLayer: false).ToJson().FromJson(), Tags = TagsHelper.GetTagsDictionary(this.Tag), Properties = this.Properties.ToResourcePropertiesBody(), }; diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs index 2fb062f0d08e..e34656e57e10 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs @@ -29,12 +29,12 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("ExtensionResourceName")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] [ValidateNotNullOrEmpty] public string LockName { get; set; } @@ -42,7 +42,7 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("Level")] - [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The level of the lock.")] + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The level of the lock.")] [ValidateNotNullOrEmpty] public LockLevel LockLevel { get; set; } @@ -50,7 +50,7 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("Notes")] - [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The notes of the lock.")] + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The notes of the lock.")] [ValidateNotNullOrEmpty] public string LockNotes { get; set; } diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs index 1f4fd13dcfb0..fa749836f4f9 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs @@ -27,12 +27,12 @@ public class RemoveAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("ExtensionResourceName")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] [ValidateNotNullOrEmpty] public string LockName { get; set; } diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs index 7f84ad3b9e4c..7a5e2da39c56 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs @@ -73,26 +73,26 @@ public abstract class ResourceLockManagementCmdletBase : ResourceManagerCmdletBa /// /// Gets or sets the resource name parameter. /// - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] [ValidateNotNullOrEmpty] public string ResourceName { get; set; } /// /// Gets or sets the resource type parameter. /// - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] [ValidateNotNullOrEmpty] public string ResourceType { get; set; } /// /// Gets or sets the resource group name parameter. /// - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource group name.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource group name.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] [ValidateNotNullOrEmpty] public string ResourceGroupName { get; set; } diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs index e77d64b07c89..cdb94e6ff6dd 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs @@ -53,6 +53,15 @@ public sealed class SetAzureResourceCmdlet : ResourceManipulationCmdletBase [ValidateNotNullOrEmpty] public Hashtable Plan { get; set; } + /// + /// Gets or sets the plan object. + /// + [Alias("SkuObject")] + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents sku properties.")] + [ValidateNotNullOrEmpty] + public Hashtable Sku { get; set; } + + /// /// Gets or sets the tags. /// @@ -165,6 +174,7 @@ private JToken GetResourceBody() { Kind = this.Kind, Plan = this.Plan.ToDictionary(addValueLayer: false).ToJson().FromJson(), + Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson(), Tags = TagsHelper.GetTagsDictionary(this.Tag), Properties = this.Properties.ToResourcePropertiesBody(), }.ToJToken(); @@ -176,6 +186,7 @@ private JToken GetResourceBody() { Kind = this.Kind ?? resource.Kind, Plan = this.Plan.ToDictionary(addValueLayer: false).ToJson().FromJson() ?? resource.Plan, + Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson() ?? resource.Sku, Tags = TagsHelper.GetTagsDictionary(this.Tag) ?? resource.Tags, Location = resource.Location, Properties = this.Properties == null ? resource.Properties : this.Properties.ToResourcePropertiesBody(), @@ -194,7 +205,7 @@ private JToken GetResourceBody() /// private bool ShouldUsePatchSemantics() { - return this.UsePatchSemantics || (this.Tag != null && this.Plan == null && this.Properties == null && this.Kind == null); + return this.UsePatchSemantics || ((this.Tag != null || this.Sku != null) && this.Plan == null && this.Properties == null && this.Kind == null); } /// diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.ps1 b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.ps1 index 1443513b2ef7..88612b3bb834 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.ps1 +++ b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.ps1 @@ -27,9 +27,9 @@ function Test-CreatesNewSimpleResource $resourceType = "Microsoft.Sql/servers" # Test - New-AzureRmResourceGroup -Name $rgname -Location $rglocation - $actual = New-AzureRmResource -Name $rname -Location $location -Tags @{Name = "testtag"; Value = "testval"} -ResourceGroupName $rgname -ResourceType $resourceType -PropertyObject @{"administratorLogin" = "adminuser"; "administratorLoginPassword" = "P@ssword1"} -ApiVersion $apiversion - $expected = Get-AzureRmResource -Name $rname -ResourceGroupName $rgname -ResourceType $resourceType -ApiVersion $apiversion + New-AzureRMResourceGroup -Name $rgname -Location $rglocation + $actual = New-AzureRMResource -Name $rname -Location $location -Tags @{Name = "testtag"; Value = "testval"} -ResourceGroupName $rgname -ResourceType $resourceType -PropertyObject @{"administratorLogin" = "adminuser"; "administratorLoginPassword" = "P@ssword1"} -SkuObject @{ Name = "A0" } -ApiVersion $apiversion + $expected = Get-AzureRMResource -Name $rname -ResourceGroupName $rgname -ResourceType $resourceType -ApiVersion $apiversion $list = Get-AzureRmResource -ResourceGroupName $rgname @@ -38,7 +38,8 @@ function Test-CreatesNewSimpleResource Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName Assert-AreEqual $expected.ResourceType $actual.ResourceType Assert-AreEqual 1 @($list).Count - Assert-AreEqual $expected.Name $list[0].Name + Assert-AreEqual $expected.Name $list[0].Name + Assert-AreEqual $expected.Sku $actual.Sku } <# @@ -258,12 +259,14 @@ function Test-SetAResource $resourceType = "Providers.Test/statefulResources" # Test - New-AzureRmResourceGroup -Name $rgname -Location $rglocation - $resource = New-AzureRmResource -Name $rname -Location $rglocation -Tags @{Name = "testtag"; Value = "testval"} -ResourceGroupName $rgname -ResourceType $resourceType -PropertyObject @{"key" = "value"} -ApiVersion $apiversion -Force - Set-AzureRmResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType -Properties @{"key2" = "value2"} -Force + New-AzureRMResourceGroup -Name $rgname -Location $rglocation + $resource = New-AzureRMResource -Name $rname -Location $rglocation -Tags @{Name = "testtag"; Value = "testval"} -ResourceGroupName $rgname -ResourceType $resourceType -PropertyObject @{"key" = "value"} -SkuObject @{ Name = "A0" } -ApiVersion $apiversion -Force + Set-AzureRMResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType -Properties @{"key2" = "value2"} -Force + Set-AzureRMResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType -SkuObject @{ Name = "A1" } -Force $modifiedResource = Get-AzureRmResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType # Assert Assert-AreEqual $modifiedResource.Properties.key2 "value2" + Assert-AreEqual $modifiedResource.Sku.Name "A1" } \ No newline at end of file diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs index a6ef20f6f731..1fcfda56a2ef 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs @@ -33,7 +33,7 @@ public class GetAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet [ValidateNotNullOrEmpty] public string Name { get; set; } - [Parameter(Position = 2, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The provisioning state of the resource group deployment.")] + [Parameter(Mandatory = false, HelpMessage = "The provisioning state of the resource group deployment.")] [ValidateNotNullOrEmpty] public string ProvisioningState { get; set; } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs index 6c2cb4ca451f..962a9be5c661 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs @@ -33,10 +33,10 @@ public class RemoveAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet [ValidateNotNullOrEmpty] public string Name { get; set; } - [Parameter(Position = 2, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Do not confirm the remove.")] + [Parameter(Mandatory = false, HelpMessage = "Do not confirm the remove.")] public SwitchParameter Force { get; set; } - [Parameter(Position = 3, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "True if succeed, false otherwise.")] + [Parameter(Mandatory = false, HelpMessage = "True if succeed, false otherwise.")] public SwitchParameter PassThru { get; set; } protected override void ProcessRecord() diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs index 96eb42dde0a1..ea39ebf3213e 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs @@ -33,10 +33,10 @@ public class StopAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet [ValidateNotNullOrEmpty] public string Name { get; set; } - [Parameter(Position = 2, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Do not confirm the stop.")] + [Parameter(Mandatory = false, HelpMessage = "Do not confirm the stop.")] public SwitchParameter Force { get; set; } - [Parameter(Position = 3, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "True if succeed, false otherwise.")] + [Parameter(Mandatory = false, HelpMessage = "True if succeed, false otherwise.")] public SwitchParameter PassThru { get; set; } protected override void ProcessRecord() diff --git a/src/ResourceManager/Resources/Resources.sln b/src/ResourceManager/Resources/Resources.sln index 66039cf34c54..8fb07dab530d 100644 --- a/src/ResourceManager/Resources/Resources.sln +++ b/src/ResourceManager/Resources/Resources.sln @@ -18,6 +18,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -52,6 +54,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/SiteRecovery/SiteRecovery.sln b/src/ResourceManager/SiteRecovery/SiteRecovery.sln index bfeae087f99c..2136cd6804f0 100644 --- a/src/ResourceManager/SiteRecovery/SiteRecovery.sln +++ b/src/ResourceManager/SiteRecovery/SiteRecovery.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Sql/Sql.sln b/src/ResourceManager/Sql/Sql.sln index 3219786c5e1d..8dcf5b48785b 100644 --- a/src/ResourceManager/Sql/Sql.sln +++ b/src/ResourceManager/Sql/Sql.sln @@ -30,6 +30,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights", "..\Insights\Commands.Insights\Commands.Insights.csproj", "{DEA446A1-84E2-46CC-B780-EB4AFDE2460E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -88,6 +90,10 @@ Global {DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Debug|Any CPU.Build.0 = Debug|Any CPU {DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Release|Any CPU.ActiveCfg = Release|Any CPU {DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Release|Any CPU.Build.0 = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Storage/Storage.sln b/src/ResourceManager/Storage/Storage.sln index ae60ddee819c..7af18caf0872 100644 --- a/src/ResourceManager/Storage/Storage.sln +++ b/src/ResourceManager/Storage/Storage.sln @@ -8,6 +8,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Storage", "..\..\Common\Storage\Commands.Storage\Commands.Storage.csproj", "{08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,6 +28,10 @@ Global {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Debug|Any CPU.Build.0 = Debug|Any CPU {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Release|Any CPU.ActiveCfg = Release|Any CPU {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Release|Any CPU.Build.0 = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Tags/Tags.sln b/src/ResourceManager/Tags/Tags.sln index 9bf51fbfe0e2..d4527bd8a3d9 100644 --- a/src/ResourceManager/Tags/Tags.sln +++ b/src/ResourceManager/Tags/Tags.sln @@ -6,6 +6,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ResourceManager.Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -20,6 +22,10 @@ Global {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/TrafficManager/TrafficManager.sln b/src/ResourceManager/TrafficManager/TrafficManager.sln index a54f92b7ffb0..86bd2ca81848 100644 --- a/src/ResourceManager/TrafficManager/TrafficManager.sln +++ b/src/ResourceManager/TrafficManager/TrafficManager.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources", "..\Re EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", "..\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.csproj", "{8058D403-06E3-4BED-8924-D166CE303961}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {8058D403-06E3-4BED-8924-D166CE303961}.Debug|Any CPU.Build.0 = Debug|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.ActiveCfg = Release|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/UsageAggregates/UsageAggregates.sln b/src/ResourceManager/UsageAggregates/UsageAggregates.sln index e55a5c9266bb..1f0626abd5e7 100644 --- a/src/ResourceManager/UsageAggregates/UsageAggregates.sln +++ b/src/ResourceManager/UsageAggregates/UsageAggregates.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Websites/WebSites.sln b/src/ResourceManager/Websites/WebSites.sln index 62ffa02e0f9a..e9c3057d83e7 100644 --- a/src/ResourceManager/Websites/WebSites.sln +++ b/src/ResourceManager/Websites/WebSites.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tools/AzureRM/AzureRM.psd1 b/tools/AzureRM/AzureRM.psd1 index 740ba03a61cb..51fd7597bf01 100644 Binary files a/tools/AzureRM/AzureRM.psd1 and b/tools/AzureRM/AzureRM.psd1 differ diff --git a/tools/AzureRM/AzureRM.psm1 b/tools/AzureRM/AzureRM.psm1 index 0f61bd8f478b..f28ba6e28a7a 100644 --- a/tools/AzureRM/AzureRM.psm1 +++ b/tools/AzureRM/AzureRM.psm1 @@ -1,9 +1,6 @@ -#Requires -RunAsAdministrator - $AzureRMProfileVersion = "0.9.8"; $AzureRMModules = @{ - "Azure.Storage" = "0.9.8"; "AzureRM.ApiManagement" = "0.9.8"; "AzureRM.Automation" = "0.9.8"; "AzureRM.Backup" = "0.9.8"; @@ -16,7 +13,6 @@ $AzureRMModules = @{ "AzureRM.KeyVault" = "0.9.8"; "AzureRM.Network" = "0.9.8"; "AzureRM.OperationalInsights" = "0.9.8"; - "AzureRM.Profile" = "0.9.8"; "AzureRM.RedisCache" = "0.9.8"; "AzureRM.Resources" = "0.9.8"; "AzureRM.SiteRecovery" = "0.9.8"; @@ -29,6 +25,19 @@ $AzureRMModules = @{ "AzureRM.Websites" = "0.9.8" } +function Validate-AdminRights([string]$Scope) +{ + if ($Scope -ne "CurrentUser") + { + $user = [Security.Principal.WindowsIdentity]::GetCurrent(); + $isAdmin = (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) + if($isAdmin -eq $false) + { + throw "Administrator rights are required to install Microsoft Azure modules" + } + } +} + function Import-ModuleWithVersionCheck([string]$Name,[string]$MinimumVersion,[string]$Repository,[string]$Scope) { $minVer = $MinimumVersion @@ -77,6 +86,8 @@ function Update-AzureRM $Scope = "AllUsers" } + Validate-AdminRights $Scope + Write-Output "Installing AzureRM modules." Import-ModuleWithVersionCheck "AzureRM.Profile" $AzureRMProfileVersion $Repository $Scope @@ -103,18 +114,24 @@ function Uninstall-AzureRM [string] $Repository) + Validate-AdminRights "AllUsers" + Write-Output "Uninstalling AzureRM modules." $AzureRMModules.Keys | ForEach { $moduleName = $_ if ((Get-InstalledModule | where {$_.Name -eq $moduleName}) -ne $null) { - Uninstall-Module -Name $_ -ErrorAction Stop + $minVer = $AzureRMModules[$_] + $maxVer = "$($minVer.Split(".")[0]).9999.0" + Uninstall-Module -Name $_ -MinimumVersion $minVer -MaximumVersion $maxVer -ErrorAction Stop Write-Output "$moduleName uninstalled..." } } - if ((Get-InstalledModule | where {"AzureRM.Profile" -eq $moduleName}) -ne $null) { - Uninstall-Module -Name "AzureRM.Profile" -ErrorAction Stop + if ((Get-InstalledModule | where {$_.Name -eq "AzureRM.Profile"}) -ne $null) { + $minVer = $AzureRMProfileVersion + $maxVer = "$($minVer.Split(".")[0]).9999.0" + Uninstall-Module -Name "AzureRM.Profile" -MinimumVersion $minVer -MaximumVersion $maxVer -ErrorAction Stop Write-Output "AzureRM.Profile uninstalled..." } } diff --git a/tools/PublishModules.ps1 b/tools/PublishModules.ps1 index bd21b1daf213..ed09c5844e34 100644 --- a/tools/PublishModules.ps1 +++ b/tools/PublishModules.ps1 @@ -38,7 +38,7 @@ if ([string]::IsNullOrEmpty($repositoryLocation)) if ([string]::IsNullOrEmpty($scope)) { Write-Verbose "Default scope to all" - $scope = 'all' + $scope = 'All' } Write-Host "Publishing $scope package(s)" @@ -53,10 +53,26 @@ if ($repo -ne $null) { Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation/package -InstallationPolicy Trusted } -if (($scope -eq 'all') -or ($scope -eq 'servicemanagement')) { +$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager" + +if ($scope -eq 'All') { + # Publish AzureRM.Profile first which is the common dependency + Write-Host "Publishing profile module" + Publish-Module -Path "$resourceManagerRootFolder\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName + Write-Host "Published profile module" +} + +if (($scope -eq 'All') -or ($scope -eq 'ServiceManagement')) { $modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure" # Publish Azure module - Write-Host "Publishing Azure module from $modulePath" + Write-Host "Publishing ServiceManagement(aka Azure) module from $modulePath" + Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName +} + +if (($scope -eq 'All') -or ($scope -eq 'AzureStorage')) { + $modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure\Azure.Storage" + # Publish AzureStorage module + Write-Host "Publishing AzureStorage module from $modulePath" Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName } @@ -68,15 +84,17 @@ if ($scope -eq 'AzureRM') { Write-Host "Published Azure module" } -$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager" $resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory -if ($scope -eq 'all') { - # Publish AzureRM modules +if ($scope -eq 'All') { foreach ($module in $resourceManagerModules) { - $modulePath = $module.FullName - Write-Host "Publishing $module module from $modulePath" - Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName - Write-Host "Published $module module" + # filter out AzureRM.Profile which always gets published first + # And "Azure.Storage" which is built out as test dependencies + if (($module.Name -ne "AzureRM.Profile") -and ($module.Name -ne "Azure.Storage")) { + $modulePath = $module.FullName + Write-Host "Publishing $module module from $modulePath" + Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName + Write-Host "Published $module module" + } } } else { $modulePath = Join-Path $resourceManagerRootFolder "AzureRM.$scope"