Skip to content

Commit 960b784

Browse files
committed
Merge pull request #2020 from markcowl/release-1.3.0
Retain scripts in roll-up module and fix issue with cdn commands
2 parents 49e0865 + 73e1ec8 commit 960b784

File tree

10 files changed

+150
-20
lines changed

10 files changed

+150
-20
lines changed

setup/azurecmdfiles.wxi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@
204204
<Component Id="cmp048B605B1072F4A5467F2AFFD8ED2459" Guid="*">
205205
<File Id="fil38FE506241BEC2CA3B34645613B821F3" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.AzureStackAdmin\Microsoft.AzureStack.Commands.dll" />
206206
</Component>
207-
<Component Id="cmpB2F2FF5F057BDE656891B43C18ADF020" Guid="*">
208-
<File Id="fil952FAF0371C7CCC373DBDF330DB18A87" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.AzureStackAdmin\Microsoft.AzureStack.Commands.dll-help.psd1" />
209-
</Component>
210207
<Component Id="cmp889E4CFA9046EFFEFF5D63CB61E990A6" Guid="*">
211208
<File Id="filE0954BDD89FA012B32E270ADA2F66DD8" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.AzureStackAdmin\Microsoft.AzureStack.Commands.dll-help.xml" />
212209
</Component>
@@ -506,6 +503,9 @@
506503
<Component Id="cmp87DFE6BA28632B552074C8A05968ED49" Guid="*">
507504
<File Id="filB29D13A0412832DF84301430FAF5C2EB" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Cdn\AzureRM.Tags.psd1" />
508505
</Component>
506+
<Component Id="cmp5387447D3AEFB20D850B31BB0324D032" Guid="*">
507+
<File Id="fil96612AEDAC40E485D577E1BB70E1777F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Cdn\CdnStartup.ps1" />
508+
</Component>
509509
<Component Id="cmpFCC54BA077C7C12B0A49F42DD3039435" Guid="*">
510510
<File Id="filD253995C681D155F4A3BAED9AC075F4D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Cdn\Hyak.Common.dll" />
511511
</Component>
@@ -5033,7 +5033,6 @@
50335033
<ComponentRef Id="cmpFDFB38E21048DD505BCAD31F5136992E" />
50345034
<ComponentRef Id="cmpC2439F65706917CA4AABD3AF6AFB856A" />
50355035
<ComponentRef Id="cmp048B605B1072F4A5467F2AFFD8ED2459" />
5036-
<ComponentRef Id="cmpB2F2FF5F057BDE656891B43C18ADF020" />
50375036
<ComponentRef Id="cmp889E4CFA9046EFFEFF5D63CB61E990A6" />
50385037
<ComponentRef Id="cmpA2F17B479BD0FE1A81AED68A6C03B7A0" />
50395038
<ComponentRef Id="cmp4E983C9ECBC2D4A29376A70418BE5E2B" />
@@ -5131,6 +5130,7 @@
51315130
<ComponentRef Id="cmp22BC5873E0018F5801CD486C6CBCE0C5" />
51325131
<ComponentRef Id="cmpB7108FC1E0DA3A2DABE2F5A549025C62" />
51335132
<ComponentRef Id="cmp87DFE6BA28632B552074C8A05968ED49" />
5133+
<ComponentRef Id="cmp5387447D3AEFB20D850B31BB0324D032" />
51345134
<ComponentRef Id="cmpFCC54BA077C7C12B0A49F42DD3039435" />
51355135
<ComponentRef Id="cmp984FE30B4A873A5B1BC8F7E85B1CEF85" />
51365136
<ComponentRef Id="cmp2F3E4B9B10BAC8DA1FA711C6B756E1D1" />

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/CustomDomainTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ function Test-CustomDomainGetRemoveWithRunningEndpoint
3434
$createdEndpoint = New-AzureRmCdnEndpoint -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -OriginName $originName -OriginHostName $originHostName
3535

3636
$endpoint = Get-AzureRmCdnEndpoint -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName
37-
$validateResult = Validate-AzureRmCdnCustomDomain -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -CustomDomainHostName $hostName
37+
$validateResult = Test-AzureRmCdnCustomDomain -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -CustomDomainHostName $hostName
3838
Assert-True{$validateResult.CustomDomainValidated}
39-
$validateResultbyPiping = Validate-AzureRmCdnCustomDomain -CdnEndpoint $endpoint -CustomDomainHostName $hostName
39+
$validateResultbyPiping = Test-AzureRmCdnCustomDomain -CdnEndpoint $endpoint -CustomDomainHostName $hostName
4040
Assert-True{$validateResultbyPiping.CustomDomainValidated}
4141

4242
$createdCustomDomain = New-AzureRmCdnCustomDomain -HostName $hostName -CustomDomainName $customDomainName -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName
@@ -77,9 +77,9 @@ function Test-CustomDomainGetRemoveWithStoppedEndpoint
7777
$createdEndpoint = New-AzureRmCdnEndpoint -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Location $resourceLocation -OriginName $originName -OriginHostName $originHostName
7878

7979
$endpoint = Get-AzureRmCdnEndpoint -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName
80-
$validateResult = Validate-AzureRmCdnCustomDomain -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -CustomDomainHostName $hostName
80+
$validateResult = Test-AzureRmCdnCustomDomain -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -CustomDomainHostName $hostName
8181
Assert-True{$validateResult.CustomDomainValidated}
82-
$validateResultbyPiping = Validate-AzureRmCdnCustomDomain -CdnEndpoint $endpoint -CustomDomainHostName $hostName
82+
$validateResultbyPiping = Test-AzureRmCdnCustomDomain -CdnEndpoint $endpoint -CustomDomainHostName $hostName
8383
Assert-True{$validateResultbyPiping.CustomDomainValidated}
8484

8585
$stopped = Stop-AzureRmCdnEndpoint -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false

src/ResourceManager/Cdn/Commands.Cdn.Test/ScenarioTests/EndpointTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function Test-EndpointCrudAndAction
5757
$loaded = Publish-AzureRmCdnEndpointContent -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -LoadContent @("/pic1.jpg", "/pic2.jpg") -PassThru
5858
Assert-True{$loaded}
5959

60-
$validateResult = Validate-AzureRmCdnCustomDomain -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -CustomDomainHostName "unverifiedcustomdomain.com"
60+
$validateResult = Test-AzureRmCdnCustomDomain -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -CustomDomainHostName "unverifiedcustomdomain.com"
6161
Assert-False{$validateResult.CustomDomainValidated}
6262

6363
$endpointRemoved = Remove-AzureRmCdnEndpoint -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false -PassThru
@@ -113,7 +113,7 @@ function Test-EndpointCrudAndActionWithPiping
113113
$loaded = Publish-AzureRmCdnEndpointContent -CdnEndpoint $createdEndpoint -LoadContent @("/pic1.jpg", "/pic2.jpg") -PassThru
114114
Assert-True{$loaded}
115115

116-
$validateResultbyPiping = Validate-AzureRmCdnCustomDomain -CdnEndpoint $createdEndpoint -CustomDomainHostName "unverifiedcustomdomain.com"
116+
$validateResultbyPiping = Test-AzureRmCdnCustomDomain -CdnEndpoint $createdEndpoint -CustomDomainHostName "unverifiedcustomdomain.com"
117117
Assert-False{$validateResultbyPiping.CustomDomainValidated}
118118

119119
$startedEndpoint.OriginHostHeader = "www.microsoft.com"
@@ -201,7 +201,7 @@ function Test-EndpointCrudAndActionWithAllProperties
201201
$loaded = Publish-AzureRmCdnEndpointContent -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -LoadContent @("/pic1.jpg", "/pic2.jpg") -PassThru
202202
Assert-True{$loaded}
203203

204-
$validateResult = Validate-AzureRmCdnCustomDomain -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -CustomDomainHostName "unverifiedcustomdomain.com"
204+
$validateResult = Test-AzureRmCdnCustomDomain -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -CustomDomainHostName "unverifiedcustomdomain.com"
205205
Assert-False{$validateResult.CustomDomainValidated}
206206

207207
$endpointRemoved = Remove-AzureRmCdnEndpoint -EndpointName $endpointName -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false -PassThru
@@ -337,7 +337,7 @@ function Test-EndpointCrudAndActionWithStoppedEndpoint
337337
$loaded = Publish-AzureRmCdnEndpointContent -CdnEndpoint $createdEndpoint -LoadContent @("/pic1.jpg", "/pic2.jpg") -PassThru
338338
Assert-True{$loaded}
339339

340-
$validateResultbyPiping = Validate-AzureRmCdnCustomDomain -CdnEndpoint $endpoint -CustomDomainHostName "unverifiedcustomdomain.com"
340+
$validateResultbyPiping = Test-AzureRmCdnCustomDomain -CdnEndpoint $endpoint -CustomDomainHostName "unverifiedcustomdomain.com"
341341
Assert-False{$validateResultbyPiping.CustomDomainValidated}
342342

343343
$startedEndpoint.OriginHostHeader = "www.microsoft.com"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
@{
16+
"Validate-AzureRmCdnCustomDomain" = "Test-AzureRmCdnCustomDomain";
17+
}.GetEnumerator() | Select @{Name='Name'; Expression={$_.Key}}, @{Name='Value'; Expression={$_.Value}} | New-Alias -Description "AzureAlias"

src/ResourceManager/Cdn/Commands.Cdn/Commands.Cdn.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
<Compile Include="Endpoint\SetAzureRmCdnEndpoint.cs" />
107107
<Compile Include="Endpoint\StartAzureRmCdnEndpoint.cs" />
108108
<Compile Include="Endpoint\StopAzureRmCdnEndpoint.cs" />
109-
<Compile Include="Endpoint\ValidateAzureRmCdnCustomDomain.cs" />
109+
<Compile Include="Endpoint\TestAzureRmCdnCustomDomain.cs" />
110110
<Compile Include="Helpers\ModelExtensions.cs" />
111111
<Compile Include="Models\CustomDomain\PSCustomDomain.cs" />
112112
<Compile Include="Models\CustomDomain\PSCustomDomainResourceState.cs" />
@@ -169,7 +169,7 @@
169169
</ProjectReference>
170170
</ItemGroup>
171171
<ItemGroup>
172-
<None Include="..\AzureRM.Cdn.psd1">
172+
<None Include="..\AzureRM.Cdn.psd1">
173173
<Link>AzureRM.Cdn.psd1</Link>
174174
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
175175
</None>
@@ -178,6 +178,9 @@
178178
<None Include="packages.config">
179179
<SubType>Designer</SubType>
180180
</None>
181+
<None Include="CdnStartup.ps1">
182+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
183+
</None>
181184
</ItemGroup>
182185
<ItemGroup>
183186
<EmbeddedResource Include="Properties\Resources.resx">

src/ResourceManager/Cdn/Commands.Cdn/CustomDomain/NewAzureRmCdnCustomDomain.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using System.IO;
1617
using System.Management.Automation;
1718
using System.Net;
19+
using System.Reflection;
1820
using Microsoft.Azure.Commands.Cdn.Common;
1921
using Microsoft.Azure.Commands.Cdn.Helpers;
2022
using Microsoft.Azure.Commands.Cdn.Models.CustomDomain;
2123
using Microsoft.Azure.Commands.Cdn.Properties;
24+
using Microsoft.Azure.Commands.Common.Authentication;
2225
using Microsoft.Azure.Management.Cdn;
2326
using Microsoft.Azure.Management.Cdn.Models;
2427

2528
namespace Microsoft.Azure.Commands.Cdn.CustomDomain
2629
{
2730
[Cmdlet(VerbsCommon.New, "AzureRmCdnCustomDomain"), OutputType(typeof(PSCustomDomain))]
28-
public class NewAzureRmCdnCustomDomain : AzureCdnCmdletBase
31+
public class NewAzureRmCdnCustomDomain : AzureCdnCmdletBase, IModuleAssemblyInitializer
2932
{
3033
[Parameter(Mandatory = true, HelpMessage = "Host name of the Azure Cdn CustomDomain name.")]
3134
[ValidateNotNullOrEmpty]
@@ -90,5 +93,15 @@ public override void ExecuteCmdlet()
9093
}
9194
}
9295
}
96+
97+
public void OnImport()
98+
{
99+
System.Management.Automation.PowerShell invoker = null;
100+
invoker = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
101+
invoker.AddScript(File.ReadAllText(FileUtilities.GetContentFilePath(
102+
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
103+
"CdnStartup.ps1")));
104+
invoker.Invoke();
105+
}
93106
}
94107
}

src/ResourceManager/Cdn/Commands.Cdn/Endpoint/ValidateAzureRmCdnCustomDomain.cs renamed to src/ResourceManager/Cdn/Commands.Cdn/Endpoint/TestAzureRmCdnCustomDomain.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
namespace Microsoft.Azure.Commands.Cdn.Endpoint
2323
{
24-
[Cmdlet("Validate", "AzureRmCdnCustomDomain"), OutputType(typeof(PSValidateCustomDomainOutput))]
25-
public class ValidateAzureRmCdnCustomDomain : AzureCdnCmdletBase
24+
[Cmdlet(VerbsDiagnostic.Test, "AzureRmCdnCustomDomain"), OutputType(typeof(PSValidateCustomDomainOutput))]
25+
public class TestAzureRmCdnCustomDomain : AzureCdnCmdletBase
2626
{
2727
[Parameter(Mandatory = true, ParameterSetName = FieldsParameterSet, HelpMessage = "Azure Cdn endpoint name.")]
2828
[ValidateNotNullOrEmpty]

src/ResourceManager/Cdn/Commands.Cdn/Microsoft.Azure.Commands.Cdn.dll-help.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3463,7 +3463,7 @@
34633463
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
34643464
<!--Generated by PS Cmdlet Help Editor-->
34653465
<command:details>
3466-
<command:name>Validate-AzureRmCdnCustomDomain</command:name>
3466+
<command:name>Test-AzureRmCdnCustomDomain</command:name>
34673467
<maml:description>
34683468
<maml:para>Validate the custom domain</maml:para>
34693469
</maml:description>
@@ -3479,7 +3479,7 @@
34793479
</maml:description>
34803480
<command:syntax>
34813481
<command:syntaxItem>
3482-
<maml:name>Validate-AzureRmCdnCustomDomain</maml:name>
3482+
<maml:name>Test-AzureRmCdnCustomDomain</maml:name>
34833483
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
34843484
<maml:name>EndpointName</maml:name>
34853485
<maml:description>
@@ -3524,7 +3524,7 @@
35243524
</command:parameter>
35253525
</command:syntaxItem>
35263526
<command:syntaxItem>
3527-
<maml:name>Validate-AzureRmCdnCustomDomain</maml:name>
3527+
<maml:name>Test-AzureRmCdnCustomDomain</maml:name>
35283528
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="named">
35293529
<maml:name>CdnEndpoint</maml:name>
35303530
<maml:description>

tools/AzureRM/AzureRM.psd1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
@{
1010

11+
#Base module
12+
RootModule = '.\AzureRM.psm1'
13+
1114
# Version number of this module.
1215
ModuleVersion = '1.3.0'
1316

tools/AzureRM/AzureRM.psm1

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
3+
4+
<#
5+
.Synopsis
6+
DEPRECATED - Installing the AzureRM installs all AzureRM cmdlets.
7+
8+
.Description
9+
DEPRECATED - Installing the AzureRM installs all AzureRM cmdlets.
10+
11+
.Parameter MajorVersion
12+
DEPRECATED -Specifies the major version.
13+
14+
.Parameter Repository
15+
DEPRECATED - Limit the search for "AzureRM" cmdlets in a specific repository.
16+
17+
.Parameter Scope
18+
DEPRECATED - Specifies the parameter scope.
19+
20+
.Parameter Force
21+
DEPRECATED - Force download and installation of modules already installed.
22+
#>
23+
function Update-AzureRM
24+
{
25+
26+
param(
27+
[Parameter(Position=0, Mandatory = $false)]
28+
[string]
29+
$MajorVersion,
30+
[Parameter(Position=1, Mandatory = $false)]
31+
[string]
32+
$Repository = "PSGallery",
33+
[Parameter(Position=2, Mandatory = $false)]
34+
[ValidateSet("CurrentUser","AllUsers")]
35+
[string]
36+
$Scope = "AllUsers",
37+
[switch]
38+
$Force = $false)
39+
40+
41+
Write-Output "DEPRECATED - This cmdlet is no longer necessary - installing the AzureRM module installs all AzureRM cmdlets."
42+
43+
44+
}
45+
46+
<#
47+
.Synopsis
48+
DEPRECATED - If using WMF5, you can run Import-Module AzureRM to load all AzureRM modules.
49+
50+
.Description
51+
DEPRECATED - If using WMF5, you can run Import-Module AzureRM to load all AzureRM modules.
52+
53+
.Parameter MajorVersion
54+
DEPRECATED - Specifies the major version.
55+
#>
56+
function Import-AzureRM
57+
{
58+
param(
59+
[Parameter(Position=0, Mandatory = $false)]
60+
[string]
61+
$MajorVersion )
62+
Write-Output "DEPRECATED - If using Windows Management Framework 5, you can load all modules using 'Import-Module AzureRM'."
63+
64+
65+
}
66+
67+
68+
69+
<#
70+
.Synopsis
71+
DEPRECATED - please uninstall each module using 'Uninstall-Module Azure* -Force'
72+
73+
.Description
74+
DEPRECATED - this cmdlet has no effect on installed modules
75+
76+
.Parameter MajorVersion
77+
DEPRECATED - Specifies the major version.
78+
#>
79+
function Uninstall-AzureRM
80+
{
81+
param(
82+
[Parameter(Position=0, Mandatory = $false)]
83+
[string]
84+
$MinVersion)
85+
86+
87+
88+
Write-Output "DEPRECATED - to uninstall azure modules, run 'Uninstall-Module AzureRm', then 'Uninstall-Module Azure* -Force'"
89+
90+
91+
}
92+
93+
New-Alias -Name Install-AzureRM -Value Update-AzureRM
94+
Export-ModuleMember -function Uninstall-AzureRM, Update-AzureRM, Import-AzureRM -Alias Install-AzureRM

0 commit comments

Comments
 (0)