Skip to content

Commit 38319f7

Browse files
unknownunknown
authored andcommitted
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents c53e6a3 + 480d0da commit 38319f7

File tree

49 files changed

+1812
-1389
lines changed

Some content is hidden

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

49 files changed

+1812
-1389
lines changed

AzurePowershell.Test.targets

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<ComputeTestDebug>.\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll</ComputeTestDebug>
1212
<NetworkTestDebug>.\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll</NetworkTestDebug>
1313
<AzureRTTestSettings>.\src\AzureRT.testsettings</AzureRTTestSettings>
14+
<AzureRTSeqTestSettings>.\src\AzureRTSeq.testsettings</AzureRTSeqTestSettings>
1415
<AzureRTTestContainer>.\src\ServiceManagement\Compute\Commands.ServiceManagement.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Test.dll</AzureRTTestContainer>
1516
<StorageScenarioTestDebug>src\ServiceManagement\Storage\Commands.Storage.ScenarioTest\bin\Debug\CLITest.dll</StorageScenarioTestDebug>
1617
<ManagementTestDebug>.\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll</ManagementTestDebug>
@@ -265,19 +266,11 @@
265266
ContinueOnError="false" />
266267
</Target>
267268

268-
<Target Name="AzureRTBVTsSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
269-
<Message Importance="high" Text="Running AzureRT BVT tests..." />
270-
<Delete Files="$(TestOutputDirectory)\RTBVTDebug.trx" />
271-
<Exec
272-
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:BVT /resultsfile:$(TestOutputDirectory)\RTBVTDebug.trx"
273-
ContinueOnError="false" />
274-
</Target>
275-
276269
<Target Name="AzureRTOne" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
277270
<Message Importance="high" Text="Running a specific tests..." />
278271
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
279272
<Exec
280-
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
273+
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
281274
ContinueOnError="false" />
282275
</Target>
283276

@@ -293,15 +286,15 @@
293286
<Message Importance="high" Text="Running tests:" />
294287
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
295288
<Exec
296-
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) $(TestParams) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
289+
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) $(TestParams) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
297290
ContinueOnError="false" />
298291
</Target>
299292

300293
<Target Name="AzureRTAll" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
301294
<Message Importance="high" Text="Running AzureRT all tests..." />
302295
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
303296
<Exec
304-
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:$(AzureRTAllTestFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
297+
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /category:$(AzureRTAllTestFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
305298
ContinueOnError="false" />
306299
</Target>
307300

@@ -311,7 +304,7 @@
311304
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
312305
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
313306
<Exec
314-
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:$(AzureRTSeqAllFilter) /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
307+
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /category:$(AzureRTSeqAllFilter) /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
315308
ContinueOnError="true" />
316309
<Exec
317310
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:$(AzureRTParAllFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
@@ -323,7 +316,7 @@
323316

324317
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
325318
<Exec
326-
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:$(AzureRTSeqAllFilter) /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
319+
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /category:$(AzureRTSeqAllFilter) /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
327320
ContinueOnError="true" />
328321
</Target>
329322

@@ -332,7 +325,7 @@
332325

333326
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
334327
<Exec
335-
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:Network /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
328+
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /category:Network /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
336329
ContinueOnError="false" />
337330
</Target>
338331

@@ -341,7 +334,7 @@
341334

342335
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
343336
<Exec
344-
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(TestSettings) /category:$(AzureRTUploadSeqFilter) /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
337+
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /category:$(AzureRTUploadSeqFilter) /resultsfile:$(TestOutputDirectory)\RTSequentialDebug.trx"
345338
ContinueOnError="false" />
346339
</Target>
347340

ChangeLog.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
2015.05.29 version 0.9.2
1+
2015.06.05 version 0.9.3
2+
* Fixed bug in Websites cmdlets related to slots #454
3+
* Fix bug in Set-AzureResource cmdlet #456
4+
* Fix for new azure resource of Microsoft.Storage #457
5+
6+
2015.05.29 version 0.9.2
27
* Deprecated Switch-AzureMode
38
* Profile
49
* Fixed bug in Get-AzureSubscription and Select-AzureSubscription cmdlets

setup/azurecmd.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33

4-
<?define productName="Microsoft Azure PowerShell - May 2015" ?>
4+
<?define productName="Microsoft Azure PowerShell - June 2015" ?>
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

8-
<?define version="0.9.2" ?>
8+
<?define version="0.9.3" ?>
99
<?define versionedStartMenuFolder="Microsoft Azure" ?>
1010
<?define staleStartMenuFolder="Windows Azure" ?>
1111

src/AzureRTSeq.testsettings

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<TestSettings
3+
id="bbc9ef85-493f-459f-bc76-434f1966c32c"
4+
name="AzureRTSeq"
5+
enableDefaultDataCollectors="false"
6+
xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
7+
<Description>These are test settings for AzureRT test run.</Description>
8+
<Deployment>
9+
<DeploymentItem filename="ServiceManagement\Compute\Commands.ServiceManagement.Test\Resources\" />
10+
<DeploymentItem filename="Package\Debug\" />
11+
</Deployment>
12+
<Execution parallelTestCount="1">
13+
<Timeouts testTimeout="3000000" />
14+
</Execution>
15+
</TestSettings>

src/Common/Commands.Common/AzurePowerShell.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public class AzurePowerShell
2727

2828
public const string AssemblyCopyright = "Copyright © Microsoft";
2929

30-
public const string AssemblyVersion = "0.9.2";
30+
public const string AssemblyVersion = "0.9.3";
3131

32-
public const string AssemblyFileVersion = "0.9.2";
32+
public const string AssemblyFileVersion = "0.9.3";
3333

3434
public const string ProfileFile = "AzureProfile.json";
3535

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function Test-AvailabilitySet
2525
{
2626
# Common
2727
$loc = 'West US';
28-
New-AzureResourceGroup -Name $rgname -Location $loc;
28+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
2929

3030
$asetName = 'avs' + $rgname;
3131
$nonDefaultUD = 2;

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/Generated/VirtualMachineDynamicTest1.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function ps_vm_dynamic_test_func_1_pstestrg1016
132132
$st = Write-Verbose "Running Test ps_vm_dynamic_test_func_1_pstestrg1016 - Start ${rgname}, ${loc} & ${vmsize}";
133133

134134
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_pstestrg1016 - Creating Resource Group';
135-
$st = New-AzureResourceGroup -Location $loc -Name $rgname;
135+
$st = New-AzureResourceGroup -Location $loc -Name $rgname -Force;
136136

137137
$vmconfig = create_and_setup_vm_config_object $loc $rgname $vmsize;
138138

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/Generated/VirtualMachineDynamicTest2.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function ps_vm_dynamic_test_func_2_pstestrg4940
132132
$st = Write-Verbose "Running Test ps_vm_dynamic_test_func_2_pstestrg4940 - Start ${rgname}, ${loc} & ${vmsize}";
133133

134134
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_2_pstestrg4940 - Creating Resource Group';
135-
$st = New-AzureResourceGroup -Location $loc -Name $rgname;
135+
$st = New-AzureResourceGroup -Location $loc -Name $rgname -Force;
136136

137137
$vmconfig = create_and_setup_vm_config_object $loc $rgname $vmsize;
138138

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/Generated/VirtualMachineDynamicTest3.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function ps_vm_dynamic_test_func_3_pstestrg575
132132
$st = Write-Verbose "Running Test ps_vm_dynamic_test_func_3_pstestrg575 - Start ${rgname}, ${loc} & ${vmsize}";
133133

134134
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_3_pstestrg575 - Creating Resource Group';
135-
$st = New-AzureResourceGroup -Location $loc -Name $rgname;
135+
$st = New-AzureResourceGroup -Location $loc -Name $rgname -Force;
136136

137137
$vmconfig = create_and_setup_vm_config_object $loc $rgname $vmsize;
138138

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function ${generated_func_name}
335335
`$st = Write-Verbose `"Running Test ${generated_func_name} - Start `${rgname}, `${loc} & `${vmsize}`";
336336
337337
`$st = Write-Verbose 'Running Test ${generated_func_name} - Creating Resource Group';
338-
`$st = New-AzureResourceGroup -Location `$loc -Name `$rgname;
338+
`$st = New-AzureResourceGroup -Location `$loc -Name `$rgname -Force;
339339
340340
`$vmconfig = create_and_setup_vm_config_object `$loc `$rgname `$vmsize;
341341

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function Test-VirtualMachineExtension
2626
{
2727
# Common
2828
$loc = 'westus';
29-
New-AzureResourceGroup -Name $rgname -Location $loc;
29+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
3030

3131
# VM Profile & Hardware
3232
$vmsize = 'Standard_A2';
@@ -203,7 +203,7 @@ function Test-VirtualMachineCustomScriptExtension
203203
{
204204
# Common
205205
$loc = 'westus';
206-
New-AzureResourceGroup -Name $rgname -Location $loc;
206+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
207207

208208
# VM Profile & Hardware
209209
$vmsize = 'Standard_A4';
@@ -359,7 +359,7 @@ function Test-VirtualMachineAccessExtension
359359
{
360360
# Common
361361
$loc = 'westus';
362-
New-AzureResourceGroup -Name $rgname -Location $loc;
362+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
363363

364364
# VM Profile & Hardware
365365
$vmsize = 'Standard_A4';

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function Test-SingleNetworkInterface
2525
{
2626
# Common
2727
$loc = 'westus';
28-
New-AzureResourceGroup -Name $rgname -Location $loc;
28+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
2929

3030
# VM Profile & Hardware
3131
$vmsize = 'Standard_A2';
@@ -148,7 +148,7 @@ function Test-SingleNetworkInterfaceDnsSettings
148148
{
149149
# Common
150150
$loc = 'westus';
151-
New-AzureResourceGroup -Name $rgname -Location $loc;
151+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
152152

153153
# VM Profile & Hardware
154154
$vmsize = 'Standard_A2';
@@ -255,7 +255,7 @@ function Test-MultipleNetworkInterface
255255
{
256256
# Common
257257
$loc = 'westus';
258-
New-AzureResourceGroup -Name $rgname -Location $loc;
258+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
259259

260260
# VM Profile & Hardware
261261
$vmsize = 'Standard_A4';

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function Test-VirtualMachine
2525
{
2626
# Common
2727
$loc = 'westus';
28-
New-AzureResourceGroup -Name $rgname -Location $loc;
28+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
2929

3030
# VM Profile & Hardware
3131
$vmsize = 'Standard_A4';
@@ -373,7 +373,7 @@ function Test-VirtualMachineSizeAndUsage
373373
{
374374
# Common
375375
$loc = 'westus';
376-
New-AzureResourceGroup -Name $rgname -Location $loc;
376+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
377377

378378
# Availability Set
379379
$asetName = 'aset' + $rgname;
@@ -544,7 +544,7 @@ function Test-VirtualMachinePIRv2
544544
{
545545
# Common
546546
$loc = 'westus';
547-
New-AzureResourceGroup -Name $rgname -Location $loc;
547+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
548548

549549
# VM Profile & Hardware
550550
$vmsize = 'Standard_A4';
@@ -654,7 +654,7 @@ function Test-VirtualMachineCapture
654654
{
655655
# Common
656656
$loc = 'westus';
657-
New-AzureResourceGroup -Name $rgname -Location $loc;
657+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
658658

659659
# VM Profile & Hardware
660660
$vmsize = 'Standard_A4';
@@ -770,7 +770,7 @@ function Test-VirtualMachineDataDisk
770770
{
771771
# Common
772772
$loc = 'westus';
773-
New-AzureResourceGroup -Name $rgname -Location $loc;
773+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
774774

775775
# VM Profile & Hardware
776776
$vmsize = 'Standard_A0';
@@ -851,7 +851,7 @@ function Test-VirtualMachinePlan
851851
{
852852
# Common
853853
$loc = 'westus';
854-
New-AzureResourceGroup -Name $rgname -Location $loc;
854+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
855855

856856
# VM Profile & Hardware
857857
$vmsize = 'Standard_A0';
@@ -935,7 +935,7 @@ function Test-VirtualMachinePlan2
935935
{
936936
# Common
937937
$loc = 'westus';
938-
New-AzureResourceGroup -Name $rgname -Location $loc;
938+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
939939

940940
# VM Profile & Hardware
941941
$vmsize = 'Standard_A0';
@@ -1021,7 +1021,7 @@ function Test-VirtualMachineTags
10211021
{
10221022
# Common
10231023
$loc = 'westus';
1024-
New-AzureResourceGroup -Name $rgname -Location $loc;
1024+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
10251025

10261026
# VM Profile & Hardware
10271027
$vmsize = 'Standard_A0';
@@ -1096,7 +1096,7 @@ function Test-VirtualMachineWithVMAgentAutoUpdate
10961096
{
10971097
# Common
10981098
$loc = 'westus';
1099-
New-AzureResourceGroup -Name $rgname -Location $loc;
1099+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
11001100

11011101
# VM Profile & Hardware
11021102
$vmsize = 'Standard_A4';
@@ -1190,7 +1190,7 @@ function Test-LinuxVirtualMachine
11901190
{
11911191
# Common
11921192
$loc = 'westus';
1193-
New-AzureResourceGroup -Name $rgname -Location $loc;
1193+
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
11941194

11951195
# VM Profile & Hardware
11961196
$vmsize = 'Standard_A4';

src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class Resource<TProperties>
3232
/// <summary>
3333
/// Gets or sets the id for the resource.
3434
/// </summary>
35-
[JsonProperty(Required = Required.Always)]
35+
[JsonProperty(Required = Required.Default)]
3636
public string Id { get; set; }
3737

3838
/// <summary>

src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Extensions/PsObjectExtensions.cs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,36 @@ private static JToken ToJToken(object value)
9999
return obj;
100100
}
101101

102-
var valueAsArray = value as Array;
103-
if (valueAsArray != null)
102+
var valueAsDictionary = value as IDictionary;
103+
if (valueAsDictionary != null)
104104
{
105-
var retVal = new JToken[valueAsArray.Length];
106-
for (int i = 0; i < valueAsArray.Length; ++i)
105+
JObject obj = new JObject();
106+
var dictionaryEntries = valueAsDictionary is IDictionary<string, object>
107+
? valueAsDictionary.OfType<KeyValuePair<string, object>>().Select(kvp => Tuple.Create(kvp.Key, kvp.Value))
108+
: valueAsDictionary.OfType<DictionaryEntry>().Select(dictionaryEntry => Tuple.Create(dictionaryEntry.Key.ToString(), dictionaryEntry.Value));
109+
110+
dictionaryEntries = dictionaryEntries.Any(dictionaryEntry => dictionaryEntry.Item1.EqualsInsensitively(Constants.MicrosoftAzureResource))
111+
? dictionaryEntries.Where(dictionaryEntry => !PsObjectExtensions.PropertiesToRemove.ContainsKey(dictionaryEntry.Item1))
112+
: dictionaryEntries;
113+
114+
foreach (var dictionaryEntry in dictionaryEntries)
115+
{
116+
obj.Add(dictionaryEntry.Item1, PsObjectExtensions.ToJToken(dictionaryEntry.Item2));
117+
}
118+
119+
return obj;
120+
}
121+
122+
var valueAsIList = value as IList;
123+
if (valueAsIList != null)
124+
{
125+
var tmpList = new List<JToken>();
126+
foreach(var v in valueAsIList)
107127
{
108-
retVal[i] = PsObjectExtensions.ToJToken(valueAsArray.GetValue(i));
128+
tmpList.Add(PsObjectExtensions.ToJToken(v));
109129
}
110130

111-
return JArray.FromObject(retVal);
131+
return JArray.FromObject(tmpList.ToArray());
112132
}
113133

114134
return new JValue(value.ToString());

0 commit comments

Comments
 (0)