Skip to content

Commit 6aa132c

Browse files
committed
Merge pull request #2 from Azure/build
pull from the build branch of Azure-PowerShell-pr
2 parents 1712c28 + 284befe commit 6aa132c

File tree

118 files changed

+50949
-11501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+50949
-11501
lines changed

ChangeLog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* Get-AzureLoadBalancerBackendAddressPoolConfig
3333
* Get-AzureLoadBalancerFrontendIpConfig
3434
* Get-AzureLoadBalancerInboundNatRuleConfig
35-
* Get-AzureLoadBalancerProbeConfig*
35+
* Get-AzureLoadBalancerProbeConfig
3636
* Get-AzureLoadBalancerRuleConfig
3737
* New-AzureLoadBalancer
3838
* New-AzureLoadBalancerBackendAddressPoolConfig
@@ -60,6 +60,7 @@
6060
* Remove-AzureNetworkSecurityRuleConfig
6161
* Add-AzureNetworkSecurityRuleConfig
6262
* Set-AzureNetworkSecurityRuleConfig
63+
* Get-AzureRemoteDesktopFile
6364
* Azure Storage
6465
* Added cmdlets in AzureResourceManager Mode
6566
* New-AzureStorageAccount

setup/azurecmdfiles.wxi

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@
9191
</Component>
9292
</Directory>
9393
<Directory Id="dir130578A4F470BDF58FEC794CB8389E91" Name="Compute">
94+
<Component Id="cmp9F0624F1A60FEC6C92BD00C0FF6D3687" Guid="*">
95+
<File Id="fil0F1880F9AF225B647105636C1209B2AD" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\AutoMapper.dll" />
96+
</Component>
9497
<Component Id="cmp8114720BD4403889B36408A1E7F419B1" Guid="*">
9598
<File Id="fil5A8265B48813A0104CB5DEEDA9CEAEAA" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\AutoMapper.Net4.dll" />
9699
</Component>
@@ -118,6 +121,9 @@
118121
<Component Id="cmp479E4B1EF0A49C9845DB071F542F5392" Guid="*">
119122
<File Id="fil6DD3CFC96544CB343D0C8F22BCFD7433" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\Microsoft.Azure.Commands.Compute.Types.ps1xml" />
120123
</Component>
124+
<Component Id="cmpDCDC7F34E3D2A51F32765B8C00AE3808" Guid="*">
125+
<File Id="fil8DBE5C6213B46E6DD6AF78238BCA09EB" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\Microsoft.Azure.Commands.Network.dll" />
126+
</Component>
121127
<Component Id="cmp3676864950F4983F3A0CFFC865B00E0C" Guid="*">
122128
<File Id="filA2B2D8901984CF14CE936FCC2B03EB27" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\Microsoft.Azure.Commands.Network.dll-Help.xml" />
123129
</Component>
@@ -160,6 +166,9 @@
160166
<Component Id="cmp054DCB81552C931A799108E58DD71095" Guid="*">
161167
<File Id="filF5F920A754551A1F476E3EBE83ADE4E0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\Microsoft.Azure.Management.Compute.dll" />
162168
</Component>
169+
<Component Id="cmp048B7D0AA1523099D2A77F903D0A1AED" Guid="*">
170+
<File Id="fil8FEBCDF89F18B6CBD6ECC3E3B0426B70" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\Microsoft.Azure.Management.Network.dll" />
171+
</Component>
163172
<Component Id="cmp7384DD0996585EE335F20A6319D5CC59" Guid="*">
164173
<File Id="fil37FF3D82AC3C550F04A5730690183DB0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\Microsoft.Azure.Management.Storage.dll" />
165174
</Component>
@@ -2923,6 +2932,9 @@
29232932
<Component Id="cmp3AC709C29C5C98FAE63EC5ACF073B2AF" Guid="*">
29242933
<File Id="filBD421847424CAE48F72C74C69770D8C0" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.Azure.Common.NetFramework.dll" />
29252934
</Component>
2935+
<Component Id="cmpF584FEE91889D98A4299209A1B9B1B94" Guid="*">
2936+
<File Id="fil1E84C52FC3BA4FCD7D38DF81574031BC" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.Azure.ResourceManager.dll" />
2937+
</Component>
29262938
<Component Id="cmp9E03AAB684EA41B087D79346AE6C1073" Guid="*">
29272939
<File Id="fil501FE0FB963E03A9292BE5CC5A895CBB" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
29282940
</Component>
@@ -2947,6 +2959,12 @@
29472959
<Component Id="cmp96B7E859E6B1867E3949455DEEB4E6FE" Guid="*">
29482960
<File Id="fil8A3864B6C6B28E31913155F493F537BC" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Commands.StorSimple.dll-help.xml" />
29492961
</Component>
2962+
<Component Id="cmp16658D499DA8ED48363EA560416B90C5" Guid="*">
2963+
<File Id="fil49777B3AFF06BAD82330CADE54BC819E" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Commands.StorSimple.format.ps1xml" />
2964+
</Component>
2965+
<Component Id="cmpF65F5AE953E042B15C547FC6387BF954" Guid="*">
2966+
<File Id="filE27288178840A36607B7A5C5D7D84C8B" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Commands.StorSimple.types.ps1xml" />
2967+
</Component>
29502968
<Component Id="cmpAD8A1A5D3992F815160303B36F74BD2B" Guid="*">
29512969
<File Id="filF37A55DDF2F7847DFC167A8CD2E537EA" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\StorSimple\Microsoft.WindowsAzure.Management.dll" />
29522970
</Component>
@@ -3077,6 +3095,7 @@
30773095
<ComponentRef Id="cmp23BAA5F27F989B6A570DA6BAB5AF6468" />
30783096
<ComponentRef Id="cmpEE1426977F06792DC1DF6EC28AA3443B" />
30793097
<ComponentRef Id="cmp512146B64C58DFB3AB394B1E97621A38" />
3098+
<ComponentRef Id="cmp9F0624F1A60FEC6C92BD00C0FF6D3687" />
30803099
<ComponentRef Id="cmp8114720BD4403889B36408A1E7F419B1" />
30813100
<ComponentRef Id="cmp8ED7930FC364D7D6CEF90AE5FBCE6DC0" />
30823101
<ComponentRef Id="cmp2E3CCDF954A1857E106A7052882B0C1F" />
@@ -3086,6 +3105,7 @@
30863105
<ComponentRef Id="cmpD5624BF8D78E80B0526773DE6E4FD2D2" />
30873106
<ComponentRef Id="cmp62942A24352ADC631A6C9DAE39D62F70" />
30883107
<ComponentRef Id="cmp479E4B1EF0A49C9845DB071F542F5392" />
3108+
<ComponentRef Id="cmpDCDC7F34E3D2A51F32765B8C00AE3808" />
30893109
<ComponentRef Id="cmp3676864950F4983F3A0CFFC865B00E0C" />
30903110
<ComponentRef Id="cmp1AA87AE1B3BBFEBD19E17639D49CDA90" />
30913111
<ComponentRef Id="cmp51F8573497DFA72CD06485162F3A1E27" />
@@ -3100,6 +3120,7 @@
31003120
<ComponentRef Id="cmp0D7B40898DEB7EE04D13AB35196E2E1B" />
31013121
<ComponentRef Id="cmp15E123AAC081CEACA89E049BD9A58CF2" />
31023122
<ComponentRef Id="cmp054DCB81552C931A799108E58DD71095" />
3123+
<ComponentRef Id="cmp048B7D0AA1523099D2A77F903D0A1AED" />
31033124
<ComponentRef Id="cmp7384DD0996585EE335F20A6319D5CC59" />
31043125
<ComponentRef Id="cmpC31383B6374C0C73A42799DA8E38FEE7" />
31053126
<ComponentRef Id="cmpFC9747F41AD02584992FEB90BAA4319A" />
@@ -3983,6 +4004,7 @@
39834004
<ComponentRef Id="cmp844CE71A108EFCC5B93A410D5205E6DB" />
39844005
<ComponentRef Id="cmp6A927AFF9D7CBE438F31603C59A5D1A6" />
39854006
<ComponentRef Id="cmp3AC709C29C5C98FAE63EC5ACF073B2AF" />
4007+
<ComponentRef Id="cmpF584FEE91889D98A4299209A1B9B1B94" />
39864008
<ComponentRef Id="cmp9E03AAB684EA41B087D79346AE6C1073" />
39874009
<ComponentRef Id="cmpEC794DBE4822765C546A06D80EAA3292" />
39884010
<ComponentRef Id="cmpB48F1BD4D2E8307615F7E22174FF4E6D" />
@@ -3991,6 +4013,8 @@
39914013
<ComponentRef Id="cmp2A4B259F8FE4D228DE8EC6FF05D891DA" />
39924014
<ComponentRef Id="cmpCD982CBC7CFC44B49F7A30F6D9C7CCC3" />
39934015
<ComponentRef Id="cmp96B7E859E6B1867E3949455DEEB4E6FE" />
4016+
<ComponentRef Id="cmp16658D499DA8ED48363EA560416B90C5" />
4017+
<ComponentRef Id="cmpF65F5AE953E042B15C547FC6387BF954" />
39944018
<ComponentRef Id="cmpAD8A1A5D3992F815160303B36F74BD2B" />
39954019
<ComponentRef Id="cmpBE0D655A7C1D36DC753F35A20389F05F" />
39964020
<ComponentRef Id="cmp6DAD84F1908D5F2A7C204E57242034FF" />

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@
6767
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.0.18.2-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6868
</Reference>
6969
<Reference Include="Microsoft.Azure.Management.Compute, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.5.0.0-preview\lib\net40\Microsoft.Azure.Management.Compute.dll</HintPath>
71-
<Private>True</Private>
70+
<SpecificVersion>False</SpecificVersion>
71+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.5.0.1-preview\lib\net40\Microsoft.Azure.Management.Compute.dll</HintPath>
7272
</Reference>
7373
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7474
<SpecificVersion>False</SpecificVersion>
7575
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.0-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
7676
</Reference>
7777
<Reference Include="Microsoft.Azure.Management.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
78-
<SpecificVersion>False</SpecificVersion>
79-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.3.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
78+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
79+
<Private>True</Private>
8080
</Reference>
8181
<Reference Include="Microsoft.Azure.ResourceManager">
8282
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
@@ -146,14 +146,11 @@
146146
<ItemGroup>
147147
<Compile Include="Common\ComputeTestController.cs" />
148148
<Compile Include="ScenarioTests\StorageAccountTests.cs" />
149-
<Compile Include="ScenarioTests\TestVirtualMachineImageList.cs" />
150-
<Compile Include="ScenarioTests\TestVirtualMachineList.cs" />
151149
<Compile Include="ScenarioTests\VirtualMachineProfileTests.cs" />
152150
<Compile Include="ScenarioTests\AvailabilitySetTests.cs" />
153151
<Compile Include="ScenarioTests\VirtualMachineExtensionTests.cs" />
154152
<Compile Include="ScenarioTests\VirtualMachineNetworkInterfaceTests.cs" />
155-
<Compile Include="ScenarioTests\TestVirtualMachineSizeAndUsage.cs" />
156-
<Compile Include="ScenarioTests\VirtualMachinePIRv2Tests.cs" />
153+
<Compile Include="ScenarioTests\UtilityFunctionTests.cs" />
157154
<Compile Include="ScenarioTests\VirtualMachineTests.cs" />
158155
<Compile Include="Properties\Resources.Designer.cs">
159156
<AutoGen>True</AutoGen>
@@ -247,6 +244,12 @@
247244
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.StorageAccountTests\TestStorageAccount.json">
248245
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
249246
</None>
247+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineExtensionTests\TestVirtualMachineAccessExtension.json">
248+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
249+
</None>
250+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineExtensionTests\TestVirtualMachineCustomScriptExtension.json">
251+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
252+
</None>
250253
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineExtensionTests\TestVirtualMachineExtension.json">
251254
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
252255
</None>
@@ -265,12 +268,27 @@
265268
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineProfileTests\TestVirtualMachineProfile.json">
266269
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
267270
</None>
271+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineDataDisk.json">
272+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
273+
</None>
268274
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineImageList.json">
269275
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
270276
</None>
271277
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineList.json">
272278
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
273279
</None>
280+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineCapture.json">
281+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
282+
</None>
283+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachinePIRv2.json">
284+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
285+
</None>
286+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachinePlan.json">
287+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
288+
</None>
289+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachinePlan2.json">
290+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
291+
</None>
274292
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineSizeAndUsage.json">
275293
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
276294
</None>

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/ComputeTestCommon.ps1

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,28 @@ function Get-ComputeTestResourceName
2828
}
2929
}
3030

31-
$assetName = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::GetAssetName($testName, "pstestrg")
31+
$oldErrorActionPreferenceValue = $ErrorActionPreference;
32+
$ErrorActionPreference = "SilentlyContinue";
33+
34+
try
35+
{
36+
$assetName = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::GetAssetName($testName, "pstestrg");
37+
}
38+
catch
39+
{
40+
if (($Error.Count -gt 0) -and ($Error[0].Exception.Message -like '*Unable to find type*'))
41+
{
42+
$assetName = Get-RandomItemName;
43+
}
44+
else
45+
{
46+
throw;
47+
}
48+
}
49+
finally
50+
{
51+
$ErrorActionPreference = $oldErrorActionPreferenceValue;
52+
}
3253

3354
return $assetName
3455
}
@@ -144,7 +165,7 @@ function Get-DefaultRDFEImage
144165

145166
<#
146167
.SYNOPSIS
147-
Gets default RDFE Image
168+
Gets default CRP Image
148169
#>
149170
function Get-DefaultCRPImage
150171
{
@@ -180,7 +201,7 @@ function Get-DefaultCRPImage
180201
$defaultSku = $result[0];
181202
}
182203

183-
$result = (Get-AzureVMImageVersion -Location $loc -Offer $defaultOffer -PublisherName $defaultPublisher -Skus $defaultSku) | select -ExpandProperty Version;
204+
$result = (Get-AzureVMImage -Location $loc -Offer $defaultOffer -PublisherName $defaultPublisher -Skus $defaultSku) | select -ExpandProperty Version;
184205
if ($result.Count -eq 1)
185206
{
186207
$defaultVersion = $result;
@@ -190,11 +211,24 @@ function Get-DefaultCRPImage
190211
$defaultVersion = $result[0];
191212
}
192213

193-
$vmimg = Get-AzureVMImage -Location $loc -Offer $defaultOffer -PublisherName $defaultPublisher -Skus $defaultSku -Version $defaultVersion;
214+
$vmimg = Get-AzureVMImageDetail -Location $loc -Offer $defaultOffer -PublisherName $defaultPublisher -Skus $defaultSku -Version $defaultVersion;
194215

195216
return $vmimg;
196217
}
197218

219+
<#
220+
.SYNOPSIS
221+
Gets VMM Images
222+
#>
223+
function Get-MarketplaceImage
224+
{
225+
param([string] $location = "eastasia", [string] $pubFilter = '*', [string] $offerFilter = '*')
226+
227+
$imgs = Get-AzureVMImagePublisher -Location $location | where { $_.PublisherName -like $pubFilter } | Get-AzureVMImageOffer | where { $_.Offer -like $offerFilter } | Get-AzureVMImageSku | Get-AzureVMImage | Get-AzureVMImageDetail | where { $_.PurchasePlan -ne $null };
228+
229+
return $imgs;
230+
}
231+
198232
<#
199233
.SYNOPSIS
200234
Gets default VM config object
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,36 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Microsoft.Azure.Commands.Compute.Models;
17+
using System;
1618
using Xunit;
1719

1820
namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests
1921
{
20-
public partial class VirtualMachineTests
22+
public class UtilityFunctionTests
2123
{
2224
[Fact]
2325
[Trait(Category.AcceptanceType, Category.CheckIn)]
24-
public void TestVirtualMachineImageList()
26+
public void TestLocationStringExtension()
2527
{
26-
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineImageList");
28+
string[] locations = new string[]
29+
{
30+
"West US",
31+
"eastus",
32+
"East Asia 2"
33+
};
34+
35+
Func<string, string> normalize = delegate(string s)
36+
{
37+
return string.IsNullOrEmpty(s) ? s : s.Replace(" ", string.Empty).ToLower();
38+
};
39+
40+
foreach (var loc in locations)
41+
{
42+
var s1 = loc.Canonicalize();
43+
var s2 = normalize(loc);
44+
Assert.True(string.Equals(s1, s2));
45+
}
2746
}
2847
}
2948
}

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,15 @@ public void TestVirtualMachineExtension()
2626
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineExtension");
2727
}
2828

29-
[Fact
30-
(Skip = "Disable this test until the breaking api is checked in.")]
29+
[Fact]
3130
[Trait(Category.AcceptanceType, Category.CheckIn)]
3231
public void TestVirtualMachineCustomScriptExtension()
3332
{
3433
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineCustomScriptExtension");
3534
}
3635

37-
[Fact
38-
(Skip = "Disable this test until the breaking api is checked in.")]
39-
[Trait(Category.AcceptanceType, Category.CheckIn)] // disable this test until the breaking api is checked in.
36+
[Fact]
37+
[Trait(Category.AcceptanceType, Category.CheckIn)]
4038
public void TestVirtualMachineAccessExtension()
4139
{
4240
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineAccessExtension");

0 commit comments

Comments
 (0)