Skip to content

Commit f97a38c

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents 8876285 + fcada69 commit f97a38c

File tree

29 files changed

+9546
-2316
lines changed

29 files changed

+9546
-2316
lines changed

ChangeLog.txt

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
2015.05.29 version 0.9.2
2+
* Deprecated Switch-AzureMode
3+
* Profile
4+
* Fixed bug in Get-AzureSubscription and Select-AzureSubscription cmdlets
5+
* Added Automation cmdlets
6+
* Get-AzureAutomationWebhook
7+
* New-AzureAutomationWebhook
8+
* Remove-AzureAutomationWebhook
9+
* Set-AzureAutomationWebhook
10+
* Azure Compute
11+
* Get-AzureVMImage and Get-AzureVMImageDetail are combined (Get-AzureVMImageDetail gives a warning message for future deprecation)
12+
* Get-AzureVMExtensionImage and Get-AzureVMExtensionImageDetail are combined (Get-AzureVMExtensionImageDetail gives a warning message for future deprecation)
13+
* Tags are added in VM resources
14+
* Get-AzureVM now gets resource group name from piping
15+
* -All switch is removed from Get-AzureVM
16+
* Get-AzureVM -Status output is updated
17+
* -Force parameter is added for Remove-AzureAvailabilitySet
18+
* Outputs of New-AzureAvailabilitySet, Get-AzureAvailabilitySet, and Remove-AzureAvailabilitySet are updated
19+
* Azure Key Vault
20+
* Update Set-AzureKeyVaultAccessPolicy and Remove-AzureKeyVaultAccessPolicy cmdlets
21+
* Fixed bugs
22+
* Azure Data Factories
23+
* Base cmdlet type switch to use Profile
24+
* New-AzureDataFactoryEncryptedValue cmdlet supporting M data sources
25+
* Azure Resource Manager
26+
* Fixed bug in Move-AzureResource cmdlet
27+
* Fixed bug in Set-AzureResource cmdlet
28+
129
2015.05.04 version 0.9.1
230
* Azure SQL Database: new support for configuring audit retention.
331
* Azure Automation
@@ -332,7 +360,7 @@
332360
* Set-AzureVMCustomScriptExtension
333361
* Set-AzureVMAccessExtension
334362
* Show 'Regions' property for Get-AzureVMAvailableExtensions cmdlet
335-
* Add 'ResizedSizeInGB' pramater for the following cmdlets
363+
* Add 'ResizedSizeInGB' parameter for the following cmdlets
336364
* Update-AzureDisk
337365
* Set-AzureOSDisk
338366
* Set-AzureDataDisk (DiskName parameter is also added along with ResizedSizeInGB)
@@ -437,7 +465,7 @@
437465
* Compute
438466
* Set-AzureVMImage cmdlets - added IconUri, SmallIconUri, and ShowInGui parameters
439467
* Sql
440-
* Added Sql Servver v12 support to SQL authentication context for SqlAzure cmdlets
468+
* Added Sql Server v12 support to SQL authentication context for SqlAzure cmdlets
441469

442470
2014.11.14 Version 0.8.11
443471
* Profile
@@ -760,7 +788,7 @@
760788
* Remove-AzureVMImageOSDiskConfig
761789
* Set-AzureVMImageDataDiskConfig
762790
* Remove-AzureVMImageDataDiskConfig
763-
* Virtual network improvments
791+
* Virtual network improvements
764792
* Set-AzureVnetGatewayKey
765793
* Azure Automation cmdlets
766794
* Get-AzureAutomationAccount

setup/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

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

setup/azurecmdfiles.wxi

Lines changed: 336 additions & 0 deletions
Large diffs are not rendered by default.

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.1";
30+
public const string AssemblyVersion = "0.9.2";
3131

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

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

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

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,14 @@ function Test-VirtualMachineProfile
2626

2727
# Network
2828
$ipname = 'hpfip' + ((Get-Random) % 10000);
29-
$ipRefUri1 = "https://test.foo.bar/$ipname";
29+
$ipRefUri = "https://test.foo.bar/$ipname";
3030
$nicName = $ipname + 'nic1';
3131
$publicIPName = $ipname + 'name1';
3232

33-
$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri1;
34-
35-
$ipname = 'hpfip' + ((Get-Random) % 10000);
36-
$ipRefUri2 = "https://test.foo.bar/$ipname";
37-
$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri2;
38-
39-
# Remove all NICs
40-
$p = $p | Remove-AzureVMNetworkInterface
41-
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces.Count 0;
42-
43-
$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri1;
44-
$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri2;
45-
$p = Remove-AzureVMNetworkInterface -VM $p -Id $ipRefUri2;
33+
$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri;
4634

4735
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces.Count 1;
48-
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].ReferenceUri $ipRefUri1;
36+
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].ReferenceUri $ipRefUri;
4937

5038
# Storage
5139
$stoname = 'hpfteststo' + ((Get-Random) % 10000);
@@ -78,23 +66,6 @@ function Test-VirtualMachineProfile
7866
Assert-AreEqual $p.StorageProfile.DataDisks[1].Lun 1;
7967
Assert-AreEqual $p.StorageProfile.DataDisks[1].VirtualHardDisk.Uri $dataDiskVhdUri2;
8068

81-
# Remove all data disks
82-
$p = $p | Remove-AzureVMDataDisk;
83-
Assert-AreEqual $p.StorageProfile.DataDisks.Count 0;
84-
85-
$p = Add-AzureVMDataDisk -VM $p -Name 'testDataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 0 -VhdUri $dataDiskVhdUri1 -CreateOption Empty;
86-
$p = Add-AzureVMDataDisk -VM $p -Name 'testDataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 1 -VhdUri $dataDiskVhdUri2 -CreateOption Empty;
87-
88-
Assert-AreEqual $p.StorageProfile.DataDisks.Count 2;
89-
Assert-AreEqual $p.StorageProfile.DataDisks[0].Caching 'ReadOnly';
90-
Assert-AreEqual $p.StorageProfile.DataDisks[0].DiskSizeGB 10;
91-
Assert-AreEqual $p.StorageProfile.DataDisks[0].Lun 0;
92-
Assert-AreEqual $p.StorageProfile.DataDisks[0].VirtualHardDisk.Uri $dataDiskVhdUri1;
93-
Assert-AreEqual $p.StorageProfile.DataDisks[1].Caching 'ReadOnly';
94-
Assert-AreEqual $p.StorageProfile.DataDisks[1].DiskSizeGB 11;
95-
Assert-AreEqual $p.StorageProfile.DataDisks[1].Lun 1;
96-
Assert-AreEqual $p.StorageProfile.DataDisks[1].VirtualHardDisk.Uri $dataDiskVhdUri2;
97-
9869
# Windows OS
9970
$user = "Foo12";
10071
$password = 'BaR@000' + ((Get-Random) % 10000);

src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.format.generated.ps1xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,6 @@
214214
<Label>StorageProfile</Label>
215215
<PropertyName>StorageProfileText</PropertyName>
216216
</ListItem>
217-
<ListItem>
218-
<Label>DataDiskNames</Label>
219-
<PropertyName>DataDiskNames</PropertyName>
220-
</ListItem>
221-
<ListItem>
222-
<Label>NetworkInterfaceIds</Label>
223-
<PropertyName>NetworkInterfaceIds</PropertyName>
224-
</ListItem>
225217
</ListItems>
226218
</ListEntry>
227219
</ListEntries>

src/ResourceManager/Compute/Commands.Compute/Models/PSVirtualMachine.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public string ResourceGroupName
3333
{
3434
get
3535
{
36-
if (string.IsNullOrEmpty(Id)) return null;
3736
Regex r = new Regex(@"(.*?)/resourcegroups/(?<rgname>\S+)/providers/(.*?)", RegexOptions.IgnoreCase);
3837
Match m = r.Match(Id);
3938
return m.Success ? m.Groups["rgname"].Value : null;
@@ -135,37 +134,5 @@ public string StorageProfileText
135134
{
136135
get { return JsonConvert.SerializeObject(StorageProfile, Formatting.Indented); }
137136
}
138-
139-
[JsonIgnore]
140-
public string [] DataDiskNames
141-
{
142-
get
143-
{
144-
if (this.StorageProfile == null) return null;
145-
146-
var dataDiskNames = new List<string>();
147-
foreach (var disk in StorageProfile.DataDisks)
148-
{
149-
dataDiskNames.Add(disk.Name);
150-
}
151-
return dataDiskNames.ToArray();
152-
}
153-
}
154-
155-
[JsonIgnore]
156-
public string[] NetworkInterfaceIds
157-
{
158-
get
159-
{
160-
if (this.NetworkProfile == null) return null;
161-
162-
var nicIds = new List<string>();
163-
foreach (var nic in NetworkProfile.NetworkInterfaces)
164-
{
165-
nicIds.Add(nic.ReferenceUri);
166-
}
167-
return nicIds.ToArray();
168-
}
169-
}
170137
}
171138
}

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Config/RemoveAzureVMDataDiskCommand.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ public class RemoveAzureVMDataDiskCommand : AzurePSCmdlet
3838
[ValidateNotNullOrEmpty]
3939
public PSVirtualMachine VM { get; set; }
4040

41-
[Alias("Name")]
4241
[Parameter(
4342
Mandatory = true,
4443
Position = 1,
4544
ValueFromPipelineByPropertyName = true,
4645
HelpMessage = HelpMessages.VMDataDiskName)]
4746
[ValidateNotNullOrEmpty]
48-
public string [] DataDiskNames { get; set; }
47+
public string Name { get; set; }
4948

5049
public override void ExecuteCmdlet()
5150
{
@@ -55,10 +54,7 @@ public override void ExecuteCmdlet()
5554
{
5655
var disks = storageProfile.DataDisks.ToList();
5756
var comp = StringComparison.OrdinalIgnoreCase;
58-
foreach (var diskName in DataDiskNames)
59-
{
60-
disks.RemoveAll(d => string.Equals(d.Name, diskName, comp));
61-
}
57+
disks.RemoveAll(d => string.Equals(d.Name, this.Name, comp));
6258
storageProfile.DataDisks = disks;
6359
}
6460

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Config/RemoveAzureVMNetworkInterfaceCommand.cs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,30 @@ public class RemoveAzureVMNetworkInterfaceCommand : AzurePSCmdlet
4141
[ValidateNotNullOrEmpty]
4242
public PSVirtualMachine VM { get; set; }
4343

44-
[Alias("Id", "NicIds")]
44+
[Alias("NicId", "NetworkInterfaceId")]
4545
[Parameter(
4646
Mandatory = true,
4747
Position = 1,
4848
ValueFromPipelineByPropertyName = true,
4949
HelpMessage = HelpMessages.VMNetworkInterfaceID)]
5050
[ValidateNotNullOrEmpty]
51-
public string[] NetworkInterfaceIds { get; set; }
51+
public string Id { get; set; }
5252

5353
public override void ExecuteCmdlet()
5454
{
5555
var networkProfile = this.VM.NetworkProfile;
5656

57-
foreach (var id in this.NetworkInterfaceIds)
57+
if (networkProfile != null && networkProfile.NetworkInterfaces != null && networkProfile.NetworkInterfaces.Any(nic => string.Equals(nic.ReferenceUri, this.Id, StringComparison.OrdinalIgnoreCase)))
5858
{
59-
if (networkProfile != null &&
60-
networkProfile.NetworkInterfaces != null &&
61-
networkProfile.NetworkInterfaces.Any(nic =>
62-
string.Equals(nic.ReferenceUri, id, StringComparison.OrdinalIgnoreCase)))
59+
var nicReference = networkProfile.NetworkInterfaces.First(nic => string.Equals(nic.ReferenceUri, this.Id, StringComparison.OrdinalIgnoreCase));
60+
networkProfile.NetworkInterfaces.Remove(nicReference);
61+
62+
if (!networkProfile.NetworkInterfaces.Any())
6363
{
64-
var nicReference = networkProfile.NetworkInterfaces.First(nic => string.Equals(nic.ReferenceUri, id, StringComparison.OrdinalIgnoreCase));
65-
networkProfile.NetworkInterfaces.Remove(nicReference);
64+
networkProfile = null;
6665
}
6766
}
6867

69-
if (!networkProfile.NetworkInterfaces.Any())
70-
{
71-
networkProfile = null;
72-
}
7368
this.VM.NetworkProfile = networkProfile;
7469

7570
WriteObject(this.VM);

src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Commands.ResourceManager.Cmdlets.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@
152152
<Compile Include="RestClients\ResourceManagerRestRestClient.cs" />
153153
<Compile Include="Utilities\HttpUtility.cs" />
154154
</ItemGroup>
155-
<ItemGroup />
155+
<ItemGroup>
156+
<Content Include="Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll-Help.xml">
157+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
158+
</Content>
159+
</ItemGroup>
156160
<ItemGroup>
157161
<None Include="MSSharedLibKey.snk" />
158162
<None Include="packages.config" />

src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceGroupDeploymentOperationCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2323
using Newtonsoft.Json.Linq;
2424

2525
/// <summary>
26-
/// Gets the resource lock.
26+
/// Gets the deployment operation.
2727
/// </summary>
2828
[Cmdlet(VerbsCommon.Get, "AzureResourceGroupDeploymentOperation"), OutputType(typeof(PSObject))]
2929
public class GetAzureResourceGroupDeploymentOperationCmdlet : ResourceManagerCmdletBase

src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/InvokeAzureResourceActionCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2222
using Newtonsoft.Json.Linq;
2323

2424
/// <summary>
25-
/// A cmdlet that creates a new azure resource.
25+
/// A cmdlet that invokes a resource action.
2626
/// </summary>
2727
[Cmdlet(VerbsLifecycle.Invoke, "AzureResourceAction", SupportsShouldProcess = true, DefaultParameterSetName = ResourceManipulationCmdletBase.ResourceIdParameterSet), OutputType(typeof(PSObject))]
2828
public sealed class InvokAzureResourceActionCmdlet : ResourceManipulationCmdletBase

src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
1818
using Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.Resources;
1919

2020
/// <summary>
21-
/// A cmdlet that creates a new azure resource.
21+
/// A cmdlet that removes an azure resource.
2222
/// </summary>
2323
[Cmdlet(VerbsCommon.Remove, "AzureResource", SupportsShouldProcess = true, DefaultParameterSetName = ResourceManipulationCmdletBase.ResourceIdParameterSet), OutputType(typeof(PSObject))]
2424
public class RemoveAzureResourceCmdlet : ResourceManipulationCmdletBase

0 commit comments

Comments
 (0)