Skip to content

. #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jun 1, 2015
Merged

. #12

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dea8301
Update Resources.resx
petrsvihlik May 17, 2015
b21fedc
fixed typos
petrsvihlik May 20, 2015
efefc4d
Merge pull request #399 from petrsvihlik/patch-1
markcowl May 22, 2015
82b1567
Updated release version
stankovski May 27, 2015
c53c972
Merge pull request #430 from stankovski/release-0.9.2
stankovski May 27, 2015
8e707e0
Fixing tests from bad merge
akromm-zz May 27, 2015
3f5717e
Adding missing DLLs to WIX installer
stankovski May 27, 2015
51a239c
Merge pull request #433 from stankovski/release-0.9.2
stankovski May 27, 2015
81ef292
Add help xml file for ARM cmdlets
vivsriaus May 27, 2015
97faee3
Merge pull request #434 from akromm/dev-pr-fixed
stankovski May 27, 2015
f231a6c
Merge pull request #435 from vivsriaus/release-0.9.2
stankovski May 27, 2015
2382078
Add help for Set-AzureResource
vivsriaus May 27, 2015
3188440
Add help for set-azureresourcelock
vivsriaus May 27, 2015
5abb5ad
Fix message
vivsriaus May 27, 2015
c4d82a3
Revert "Fix piping issue for Remove-AzureVMDataDisk"
May 27, 2015
5978c66
Revert "Add test for piping of Remove-AzureVMDataDisk and Remove-Azur…
May 22, 2015
32ae525
Add notes for ARM cmdlets
vivsriaus May 27, 2015
e8e0578
Merge pull request #437 from vivsriaus/release-0.9.2
stankovski May 28, 2015
768d789
Merge pull request #438 from hyonholee/dev3
stankovski May 28, 2015
24583ff
Merge pull request #439 from Azure/vivsriaus-patch-1
stankovski May 28, 2015
8f7bf17
Added changelog for release 0.9.2
May 30, 2015
d92b7b0
Merge pull request #445 from hovsepm/release-0.9.2
May 30, 2015
869ee19
Fixed release 0.9.2 comments
May 30, 2015
839e03f
Merge pull request #446 from hovsepm/release-0.9.2
May 30, 2015
aa13711
Merge pull request #444 from Azure/release-0.9.2
May 30, 2015
fcada69
Merge pull request #447 from Azure/master
stankovski Jun 1, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
2015.05.29 version 0.9.2
* Deprecated Switch-AzureMode
* Profile
* Fixed bug in Get-AzureSubscription and Select-AzureSubscription cmdlets
* Added Automation cmdlets
* Get-AzureAutomationWebhook
* New-AzureAutomationWebhook
* Remove-AzureAutomationWebhook
* Set-AzureAutomationWebhook
* Azure Compute
* Get-AzureVMImage and Get-AzureVMImageDetail are combined (Get-AzureVMImageDetail gives a warning message for future deprecation)
* Get-AzureVMExtensionImage and Get-AzureVMExtensionImageDetail are combined (Get-AzureVMExtensionImageDetail gives a warning message for future deprecation)
* Tags are added in VM resources
* Get-AzureVM now gets resource group name from piping
* -All switch is removed from Get-AzureVM
* Get-AzureVM -Status output is updated
* -Force parameter is added for Remove-AzureAvailabilitySet
* Outputs of New-AzureAvailabilitySet, Get-AzureAvailabilitySet, and Remove-AzureAvailabilitySet are updated
* Azure Key Vault
* Update Set-AzureKeyVaultAccessPolicy and Remove-AzureKeyVaultAccessPolicy cmdlets
* Fixed bugs
* Azure Data Factories
* Base cmdlet type switch to use Profile
* New-AzureDataFactoryEncryptedValue cmdlet supporting M data sources
* Azure Resource Manager
* Fixed bug in Move-AzureResource cmdlet
* Fixed bug in Set-AzureResource cmdlet

2015.05.04 version 0.9.1
* Azure SQL Database: new support for configuring audit retention.
* Azure Automation
Expand Down Expand Up @@ -332,7 +360,7 @@
* Set-AzureVMCustomScriptExtension
* Set-AzureVMAccessExtension
* Show 'Regions' property for Get-AzureVMAvailableExtensions cmdlet
* Add 'ResizedSizeInGB' pramater for the following cmdlets
* Add 'ResizedSizeInGB' parameter for the following cmdlets
* Update-AzureDisk
* Set-AzureOSDisk
* Set-AzureDataDisk (DiskName parameter is also added along with ResizedSizeInGB)
Expand Down Expand Up @@ -437,7 +465,7 @@
* Compute
* Set-AzureVMImage cmdlets - added IconUri, SmallIconUri, and ShowInGui parameters
* Sql
* Added Sql Servver v12 support to SQL authentication context for SqlAzure cmdlets
* Added Sql Server v12 support to SQL authentication context for SqlAzure cmdlets

2014.11.14 Version 0.8.11
* Profile
Expand Down Expand Up @@ -760,7 +788,7 @@
* Remove-AzureVMImageOSDiskConfig
* Set-AzureVMImageDataDiskConfig
* Remove-AzureVMImageDataDiskConfig
* Virtual network improvments
* Virtual network improvements
* Set-AzureVnetGatewayKey
* Azure Automation cmdlets
* Get-AzureAutomationAccount
Expand Down
2 changes: 1 addition & 1 deletion setup/azurecmd.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>

<?define version="0.9.1" ?>
<?define version="0.9.2" ?>
<?define versionedStartMenuFolder="Microsoft Azure" ?>
<?define staleStartMenuFolder="Windows Azure" ?>

Expand Down
336 changes: 336 additions & 0 deletions setup/azurecmdfiles.wxi

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Common/Commands.Common/AzurePowerShell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public class AzurePowerShell

public const string AssemblyCopyright = "Copyright © Microsoft";

public const string AssemblyVersion = "0.9.1";
public const string AssemblyVersion = "0.9.2";

public const string AssemblyFileVersion = "0.9.1";
public const string AssemblyFileVersion = "0.9.2";

public const string ProfileFile = "AzureProfile.json";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,14 @@ function Test-VirtualMachineProfile

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

$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri1;

$ipname = 'hpfip' + ((Get-Random) % 10000);
$ipRefUri2 = "https://test.foo.bar/$ipname";
$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri2;

# Remove all NICs
$p = $p | Remove-AzureVMNetworkInterface
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces.Count 0;

$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri1;
$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri2;
$p = Remove-AzureVMNetworkInterface -VM $p -Id $ipRefUri2;
$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri;

Assert-AreEqual $p.NetworkProfile.NetworkInterfaces.Count 1;
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].ReferenceUri $ipRefUri1;
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].ReferenceUri $ipRefUri;

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

# Remove all data disks
$p = $p | Remove-AzureVMDataDisk;
Assert-AreEqual $p.StorageProfile.DataDisks.Count 0;

$p = Add-AzureVMDataDisk -VM $p -Name 'testDataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 0 -VhdUri $dataDiskVhdUri1 -CreateOption Empty;
$p = Add-AzureVMDataDisk -VM $p -Name 'testDataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 1 -VhdUri $dataDiskVhdUri2 -CreateOption Empty;

Assert-AreEqual $p.StorageProfile.DataDisks.Count 2;
Assert-AreEqual $p.StorageProfile.DataDisks[0].Caching 'ReadOnly';
Assert-AreEqual $p.StorageProfile.DataDisks[0].DiskSizeGB 10;
Assert-AreEqual $p.StorageProfile.DataDisks[0].Lun 0;
Assert-AreEqual $p.StorageProfile.DataDisks[0].VirtualHardDisk.Uri $dataDiskVhdUri1;
Assert-AreEqual $p.StorageProfile.DataDisks[1].Caching 'ReadOnly';
Assert-AreEqual $p.StorageProfile.DataDisks[1].DiskSizeGB 11;
Assert-AreEqual $p.StorageProfile.DataDisks[1].Lun 1;
Assert-AreEqual $p.StorageProfile.DataDisks[1].VirtualHardDisk.Uri $dataDiskVhdUri2;

# Windows OS
$user = "Foo12";
$password = 'BaR@000' + ((Get-Random) % 10000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,6 @@
<Label>StorageProfile</Label>
<PropertyName>StorageProfileText</PropertyName>
</ListItem>
<ListItem>
<Label>DataDiskNames</Label>
<PropertyName>DataDiskNames</PropertyName>
</ListItem>
<ListItem>
<Label>NetworkInterfaceIds</Label>
<PropertyName>NetworkInterfaceIds</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public string ResourceGroupName
{
get
{
if (string.IsNullOrEmpty(Id)) return null;
Regex r = new Regex(@"(.*?)/resourcegroups/(?<rgname>\S+)/providers/(.*?)", RegexOptions.IgnoreCase);
Match m = r.Match(Id);
return m.Success ? m.Groups["rgname"].Value : null;
Expand Down Expand Up @@ -135,37 +134,5 @@ public string StorageProfileText
{
get { return JsonConvert.SerializeObject(StorageProfile, Formatting.Indented); }
}

[JsonIgnore]
public string [] DataDiskNames
{
get
{
if (this.StorageProfile == null) return null;

var dataDiskNames = new List<string>();
foreach (var disk in StorageProfile.DataDisks)
{
dataDiskNames.Add(disk.Name);
}
return dataDiskNames.ToArray();
}
}

[JsonIgnore]
public string[] NetworkInterfaceIds
{
get
{
if (this.NetworkProfile == null) return null;

var nicIds = new List<string>();
foreach (var nic in NetworkProfile.NetworkInterfaces)
{
nicIds.Add(nic.ReferenceUri);
}
return nicIds.ToArray();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ public class RemoveAzureVMDataDiskCommand : AzurePSCmdlet
[ValidateNotNullOrEmpty]
public PSVirtualMachine VM { get; set; }

[Alias("Name")]
[Parameter(
Mandatory = true,
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = HelpMessages.VMDataDiskName)]
[ValidateNotNullOrEmpty]
public string [] DataDiskNames { get; set; }
public string Name { get; set; }

public override void ExecuteCmdlet()
{
Expand All @@ -55,10 +54,7 @@ public override void ExecuteCmdlet()
{
var disks = storageProfile.DataDisks.ToList();
var comp = StringComparison.OrdinalIgnoreCase;
foreach (var diskName in DataDiskNames)
{
disks.RemoveAll(d => string.Equals(d.Name, diskName, comp));
}
disks.RemoveAll(d => string.Equals(d.Name, this.Name, comp));
storageProfile.DataDisks = disks;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,30 @@ public class RemoveAzureVMNetworkInterfaceCommand : AzurePSCmdlet
[ValidateNotNullOrEmpty]
public PSVirtualMachine VM { get; set; }

[Alias("Id", "NicIds")]
[Alias("NicId", "NetworkInterfaceId")]
[Parameter(
Mandatory = true,
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = HelpMessages.VMNetworkInterfaceID)]
[ValidateNotNullOrEmpty]
public string[] NetworkInterfaceIds { get; set; }
public string Id { get; set; }

public override void ExecuteCmdlet()
{
var networkProfile = this.VM.NetworkProfile;

foreach (var id in this.NetworkInterfaceIds)
if (networkProfile != null && networkProfile.NetworkInterfaces != null && networkProfile.NetworkInterfaces.Any(nic => string.Equals(nic.ReferenceUri, this.Id, StringComparison.OrdinalIgnoreCase)))
{
if (networkProfile != null &&
networkProfile.NetworkInterfaces != null &&
networkProfile.NetworkInterfaces.Any(nic =>
string.Equals(nic.ReferenceUri, id, StringComparison.OrdinalIgnoreCase)))
var nicReference = networkProfile.NetworkInterfaces.First(nic => string.Equals(nic.ReferenceUri, this.Id, StringComparison.OrdinalIgnoreCase));
networkProfile.NetworkInterfaces.Remove(nicReference);

if (!networkProfile.NetworkInterfaces.Any())
{
var nicReference = networkProfile.NetworkInterfaces.First(nic => string.Equals(nic.ReferenceUri, id, StringComparison.OrdinalIgnoreCase));
networkProfile.NetworkInterfaces.Remove(nicReference);
networkProfile = null;
}
}

if (!networkProfile.NetworkInterfaces.Any())
{
networkProfile = null;
}
this.VM.NetworkProfile = networkProfile;

WriteObject(this.VM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@
<Compile Include="RestClients\ResourceManagerRestRestClient.cs" />
<Compile Include="Utilities\HttpUtility.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll-Help.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="MSSharedLibKey.snk" />
<None Include="packages.config" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
using Newtonsoft.Json.Linq;

/// <summary>
/// Gets the resource lock.
/// Gets the deployment operation.
/// </summary>
[Cmdlet(VerbsCommon.Get, "AzureResourceGroupDeploymentOperation"), OutputType(typeof(PSObject))]
public class GetAzureResourceGroupDeploymentOperationCmdlet : ResourceManagerCmdletBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
using Newtonsoft.Json.Linq;

/// <summary>
/// A cmdlet that creates a new azure resource.
/// A cmdlet that invokes a resource action.
/// </summary>
[Cmdlet(VerbsLifecycle.Invoke, "AzureResourceAction", SupportsShouldProcess = true, DefaultParameterSetName = ResourceManipulationCmdletBase.ResourceIdParameterSet), OutputType(typeof(PSObject))]
public sealed class InvokAzureResourceActionCmdlet : ResourceManipulationCmdletBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
using Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.Resources;

/// <summary>
/// A cmdlet that creates a new azure resource.
/// A cmdlet that removes an azure resource.
/// </summary>
[Cmdlet(VerbsCommon.Remove, "AzureResource", SupportsShouldProcess = true, DefaultParameterSetName = ResourceManipulationCmdletBase.ResourceIdParameterSet), OutputType(typeof(PSObject))]
public class RemoveAzureResourceCmdlet : ResourceManipulationCmdletBase
Expand Down
Loading