Skip to content

. #10

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 44 commits into from
May 26, 2015
Merged

. #10

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
29adff7
ADF PowerShell change for sprint 47
jackmagic313 Apr 14, 2015
94ed44d
Ported changes for commandlet rename
olignat May 5, 2015
20315a6
Fix to the new subscription registiontaion with ADF RP issue.
May 6, 2015
88d979b
Added new ADF onpremises encryption for M sources.
May 6, 2015
43b60e4
Merge branch 'dev' of https://github.com/azure/azure-powershell into dev
May 11, 2015
0d0712f
merge from public ps
jackmagic313 May 14, 2015
d1dd9b6
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
jackmagic313 May 14, 2015
2ba03da
Merge branch 'master' of https://github.com/Azure/azure-powershell in…
yoavrubin May 18, 2015
117634e
Merging alias changes with upstream dev branch changes
markcowl May 21, 2015
40f8328
Merge branch 'dev' of https://github.com/azure/azure-powershell into dev
May 21, 2015
7824e13
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yoavrubin May 21, 2015
8cbee16
Changing alias infrastructure for sql aliases
markcowl May 21, 2015
301cfe0
Deprecating Switch-AzureMode
markcowl May 21, 2015
fc59a7e
Fixes to structure for alias script
markcowl May 21, 2015
f0009d0
Upgrade ADF gateway encryption nuget version.
May 22, 2015
7edfeee
Add Force parameter to Remove-AzureAvailabilitySet
May 22, 2015
58fcb41
Combine Get-AzureVMImage and Get-AzureVMImageDetail cmdlets
May 22, 2015
39d57bf
Fix piping issue for Remove-AzureVMDataDisk
May 22, 2015
8dedf30
Merge branch 'dev' of https://github.com/huangpf/azure-powershell int…
May 22, 2015
2811ed6
Merge pull request #412 from huangpf/dev
markcowl May 22, 2015
301140c
Removing the alias option from data masking rule
yoavrubin May 22, 2015
9f910dd
Fix for combining image and imagedetails
May 22, 2015
4eaf626
Update the output of Remove-AzureAvailabilitySet cmdlet
May 22, 2015
0bcc52d
Add test for piping of Remove-AzureVMDataDisk and Remove-AzureVMNetwo…
May 22, 2015
a06dfeb
Merge branch 'dev' of https://github.com/Azure/azure-powershell into …
May 22, 2015
f33cbc3
Fixing tests
markcowl May 22, 2015
9deef66
Merge pull request #414 from yitao-zhang/dev
markcowl May 22, 2015
7774bc7
Add help file for Key Vault cmdlets
divyagandhi01 May 22, 2015
a89ec8b
Merge pull request #415 from markcowl/sqlps1
markcowl May 22, 2015
966574c
Fix bug PowerShell returns an exception when listing keys in a vault …
May 22, 2015
5757972
Change NicIds to NetworkInterfaceIds
May 22, 2015
5819480
Merge branch 'dev' of https://github.com/Azure/azure-powershell into …
May 22, 2015
9bf5b03
Merge pull request #416 from yoavrubin/dev
ogail May 22, 2015
bcf0742
Merge pull request #417 from hyonholee/dev2
ogail May 22, 2015
169e479
Merge pull request #419 from divyakgupta/dev
ogail May 22, 2015
237ab20
Merge pull request #420 from YuhuiZhong/dev
ogail May 22, 2015
100bccb
Fix output of VM object
May 22, 2015
74efb3d
Merge branch 'dev' of https://github.com/Azure/azure-powershell into …
May 22, 2015
2a5f8ba
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
jackmagic313 May 22, 2015
ec6b68f
ADF PowerShell Change for sprint 49
jackmagic313 May 23, 2015
c525427
VMImage cmdlet help file changes
May 23, 2015
bde506b
Merge pull request #421 from hyonholee/dev2
markcowl May 26, 2015
f4ae086
Merge pull request #423 from jackmagic313/dev
markcowl May 26, 2015
0eb0d57
Merge pull request #424 from singhkay/dev
markcowl May 26, 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
44 changes: 44 additions & 0 deletions setup/azurecmdfiles.wxi

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion src/Common/Commands.Common/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Common/Commands.Common/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1358,4 +1358,7 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
<data name="AzureProfileMustNotBeNull" xml:space="preserve">
<value>Selected profile must not be null.</value>
</data>
<data name="SwitchAzureModeDeprecated" xml:space="preserve">
<value>The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.</value>
</data>
</root>
2 changes: 2 additions & 0 deletions src/Common/Commands.Profile/SwitchAzureMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using System;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Common.Authentication;

Expand All @@ -34,6 +35,7 @@ public class SwitchAzureMode : AzurePSCmdlet

public override void ExecuteCmdlet()
{
WriteWarning(Resources.SwitchAzureModeDeprecated);
AzureModule moduleToImport = (AzureModule)Enum.Parse(typeof(AzureModule), Name, false);
AzureModule moduleToRemove = moduleToImport == AzureModule.AzureResourceManager ? AzureModule.AzureServiceManagement : AzureModule.AzureResourceManager;
RemoveAzureModule(FileUtilities.GetModuleName(moduleToRemove), FileUtilities.GetPSModulePathForModule(moduleToRemove));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ function Test-AvailabilitySet
Assert-AreEqual $aset.PlatformUpdateDomainCount $nonDefaultUD;
Assert-AreEqual $aset.PlatformFaultDomainCount $nonDefaultFD;

Remove-AzureAvailabilitySet -ResourceGroupName $rgname -Name $asetName;
Assert-ThrowsContains { Remove-AzureAvailabilitySet -ResourceGroupName $rgname -Name $asetName; } "This cmdlet will remove the specified availability set. Do you want to continue?"

Remove-AzureAvailabilitySet -ResourceGroupName $rgname -Name $asetName -Force;

$asets = Get-AzureAvailabilitySet -ResourceGroupName $rgname;
Assert-AreEqual $asets $null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function Get-DefaultCRPImage
$defaultVersion = $result[0];
}

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

return $vmimg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,26 @@ function Test-VirtualMachineProfile

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

$p = Add-AzureVMNetworkInterface -VM $p -Id $ipRefUri;
$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;

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

# Storage
$stoname = 'hpfteststo' + ((Get-Random) % 10000);
Expand Down Expand Up @@ -66,6 +78,23 @@ 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 @@ -252,15 +252,15 @@ function Test-VirtualMachineImageList
{
$versions = $s4 | select -ExpandProperty Version;

$s6 = Get-AzureVMImage -Location $locStr -PublisherName $pub -Offer $offer -Sku $sku -FilterExpression ('name -eq *');
Assert-NotNull $s6;
Assert-NotNull $s6.Count -gt 0;
$verNames = $s6 | select -ExpandProperty Version;
$s5 = Get-AzureVMImage -Location $locStr -PublisherName $pub -Offer $offer -Sku $sku -FilterExpression ('name -eq *');
Assert-NotNull $s5;
Assert-NotNull $s5.Count -gt 0;
$verNames = $s5 | select -ExpandProperty Version;

foreach ($ver in $versions)
{
if ($ver -eq $null -or $ver -eq '') { continue; }
$s6 = Get-AzureVMImageDetail -Location $locStr -PublisherName $pub -Offer $offer -Sku $sku -Version $ver;
$s6 = Get-AzureVMImage -Location $locStr -PublisherName $pub -Offer $offer -Sku $sku -Version $ver;
Assert-NotNull $s6;
$s6;

Expand Down Expand Up @@ -299,7 +299,7 @@ function Test-VirtualMachineImageList
$versions = $s2 | select -ExpandProperty Version;
foreach ($ver in $versions)
{
$s3 = Get-AzureVMExtensionImageDetail -Location $locStr -PublisherName $pub -Type $type -Version $ver -FilterExpression '*';
$s3 = Get-AzureVMExtensionImage -Location $locStr -PublisherName $pub -Type $type -Version $ver -FilterExpression '*';

Assert-NotNull $s3;
Assert-True { $s3.Version -eq $ver; }
Expand All @@ -316,11 +316,11 @@ function Test-VirtualMachineImageList

# Test Piping
$pubNameFilter = '*Microsoft*Windows*Server*';
$imgs = Get-AzureVMImagePublisher -Location $locStr | where { $_.PublisherName -like $pubNameFilter } | Get-AzureVMImageOffer | Get-AzureVMImageSku | Get-AzureVMImage | Get-AzureVMImageDetail;
$imgs = Get-AzureVMImagePublisher -Location $locStr | where { $_.PublisherName -like $pubNameFilter } | Get-AzureVMImageOffer | Get-AzureVMImageSku | Get-AzureVMImage | Get-AzureVMImage;
Assert-True { $imgs.Count -gt 0 };

$pubNameFilter = '*Microsoft.Compute*';
$extimgs = Get-AzureVMImagePublisher -Location $locStr | where { $_.PublisherName -like $pubNameFilter } | Get-AzureVMExtensionImageType | Get-AzureVMExtensionImage | Get-AzureVMExtensionImageDetail;
$extimgs = Get-AzureVMImagePublisher -Location $locStr | where { $_.PublisherName -like $pubNameFilter } | Get-AzureVMExtensionImageType | Get-AzureVMExtensionImage | Get-AzureVMExtensionImage;
Assert-True { $extimgs.Count -gt 0 };

# Negative Tests
Expand All @@ -341,12 +341,12 @@ function Test-VirtualMachineImageList
Assert-ThrowsContains { $s5 = Get-AzureVMImage -Location $locStr -PublisherName $publisherName -Offer $offerName -Skus $skusName -FilterExpression $filter; } "was not found";

$version = '1.0.0';
Assert-ThrowsContains { $s6 = Get-AzureVMImageDetail -Location $locStr -PublisherName $publisherName -Offer $offerName -Skus $skusName -Version $version; } "was not found";
Assert-ThrowsContains { $s6 = Get-AzureVMImage -Location $locStr -PublisherName $publisherName -Offer $offerName -Skus $skusName -Version $version; } "was not found";

# Extension Images
$type = Get-ComputeTestResourceName;
Assert-ThrowsContains { $s7 = Get-AzureVMExtensionImageDetail -Location $locStr -PublisherName $publisherName -Type $type -FilterExpression $filter -Version $version; } "was not found";
Assert-ThrowsContains { $s7 = Get-AzureVMExtensionImage -Location $locStr -PublisherName $publisherName -Type $type -FilterExpression $filter -Version $version; } "was not found";

Assert-ThrowsContains { $s8 = Get-AzureVMExtensionImageType -Location $locStr -PublisherName $publisherName; } "was not found";

Assert-ThrowsContains { $s9 = Get-AzureVMExtensionImage -Location $locStr -PublisherName $publisherName -Type $type -FilterExpression $filter; } "was not found";
Expand Down Expand Up @@ -987,7 +987,7 @@ function Test-VirtualMachinePlan2
$vmmImgOfferName = 'a10-vthunder-adc';
$vmmImgSkusName = 'vthunder_byol';
$vmmImgVerName = '1.0.0';
$imgRef = Get-AzureVMImageDetail -PublisherName $vmmImgPubName -Location $loc -Offer $vmmImgOfferName -Skus $vmmImgSkusName -Version $vmmImgVerName;
$imgRef = Get-AzureVMImage -PublisherName $vmmImgPubName -Location $loc -Offer $vmmImgOfferName -Skus $vmmImgSkusName -Version $vmmImgVerName;
$plan = $imgRef.PurchasePlan;
$p = Set-AzureVMSourceImage -VM $p -PublisherName $imgRef.PublisherName -Offer $imgRef.Offer -Skus $imgRef.Skus -Version $imgRef.Version;
$p.Plan = New-Object Microsoft.Azure.Management.Compute.Models.Plan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using AutoMapper;
using Microsoft.Azure.Commands.Compute.Common;
using Microsoft.Azure.Commands.Compute.Models;
using Microsoft.Azure.Management.Compute;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Compute
{
[Cmdlet(VerbsCommon.Remove, ProfileNouns.AvailabilitySet)]
[OutputType(typeof(PSOperationResponse))]
public class RemoveAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
{
[Parameter(
Expand All @@ -37,13 +40,24 @@ public class RemoveAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[Parameter(
Position = 2,
HelpMessage = "To force the removal.")]
[ValidateNotNullOrEmpty]
public SwitchParameter Force { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();

var op = this.AvailabilitySetClient.Delete(this.ResourceGroupName, this.Name);

WriteObject(op);
if (this.Force.IsPresent
|| this.ShouldContinue(Properties.Resources.AvailabilitySetRemovalConfirmation,
Properties.Resources.AvailabilitySetRemovalCaption))
{
AzureOperationResponse op = this.AvailabilitySetClient.Delete(this.ResourceGroupName, this.Name);
var result = Mapper.Map<PSOperationResponse>(op);
WriteObject(result);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
<Compile Include="Images\GetAzureVMImageOfferCommand.cs" />
<Compile Include="Images\GetAzureVMImageDetailCommand.cs" />
<Compile Include="Images\VirtualMachineImageBaseCmdlet.cs" />
<Compile Include="Models\PSOperationResponse.cs" />
<Compile Include="Models\PSUsage.cs" />
<Compile Include="Models\PSVirtualMachineExtensionImage.cs" />
<Compile Include="Models\PSVirtualMachineImage.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ protected override void Configure()
Mapper.CreateMap<FROM.VirtualMachine, TO.PSVirtualMachine>();
Mapper.CreateMap<FROM.VirtualMachineSize, TO.PSVirtualMachineSize>();
Mapper.CreateMap<FROM.Usage, TO.PSUsage>();

Mapper.CreateMap<FROM.ComputeLongRunningOperationResponse, TO.PSComputeLongRunningOperation>();
Mapper.CreateMap<Microsoft.Azure.AzureOperationResponse, TO.PSOperationResponse>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

namespace Microsoft.Azure.Commands.Compute
{
[Cmdlet(VerbsCommon.Get, ProfileNouns.VirtualMachineExtensionImage)]
[OutputType(typeof(PSVirtualMachineExtensionImage))]
[Cmdlet(VerbsCommon.Get,
ProfileNouns.VirtualMachineExtensionImage)]
[OutputType(typeof(PSVirtualMachineExtensionImageDetails))]
public class GetAzureVMExtensionImageCommand : VirtualMachineExtensionImageBaseCmdlet
{
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true), ValidateNotNullOrEmpty]
Expand All @@ -37,34 +38,73 @@ public class GetAzureVMExtensionImageCommand : VirtualMachineExtensionImageBaseC
[Parameter, ValidateNotNullOrEmpty]
public string FilterExpression { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true)]
public string Version { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();

var parameters = new VirtualMachineExtensionImageListVersionsParameters
if (string.IsNullOrEmpty(this.Version))
{
var parameters = new VirtualMachineExtensionImageListVersionsParameters
{
Location = Location.Canonicalize(),
PublisherName = PublisherName,
Type = Type,
FilterExpression = FilterExpression
};

VirtualMachineImageResourceList result = this.VirtualMachineExtensionImageClient.ListVersions(parameters);

var images = from r in result.Resources
select new PSVirtualMachineExtensionImage
{
RequestId = result.RequestId,
StatusCode = result.StatusCode,
Id = r.Id,
Location = r.Location,
Version = r.Name,
PublisherName = this.PublisherName,
Type = this.Type,
FilterExpression = this.FilterExpression
};

WriteObject(images, true);
}
else
{
Location = Location.Canonicalize(),
PublisherName = PublisherName,
Type = Type,
FilterExpression = FilterExpression
};

VirtualMachineImageResourceList result = this.VirtualMachineExtensionImageClient.ListVersions(parameters);
var parameters = new VirtualMachineExtensionImageGetParameters
{
Location = Location.Canonicalize(),
PublisherName = PublisherName,
Type = Type,
FilterExpression = FilterExpression,
Version = Version
};

VirtualMachineExtensionImageGetResponse result = this.VirtualMachineExtensionImageClient.Get(parameters);

var images = from r in result.Resources
select new PSVirtualMachineExtensionImage
{
RequestId = result.RequestId,
StatusCode = result.StatusCode,
Id = r.Id,
Location = r.Location,
Version = r.Name,
PublisherName = this.PublisherName,
Type = this.Type,
FilterExpression = this.FilterExpression
};
var image = new PSVirtualMachineExtensionImageDetails
{
RequestId = result.RequestId,
StatusCode = result.StatusCode,
Id = result.VirtualMachineExtensionImage.Id,
Location = result.VirtualMachineExtensionImage.Location,
Name = result.VirtualMachineExtensionImage.Name,
HandlerSchema = result.VirtualMachineExtensionImage.HandlerSchema,
OperatingSystem = result.VirtualMachineExtensionImage.OperatingSystem,
ComputeRole = result.VirtualMachineExtensionImage.ComputeRole,
SupportsMultipleExtensions = result.VirtualMachineExtensionImage.SupportsMultipleExtensions,
VMScaleSetEnabled = result.VirtualMachineExtensionImage.VMScaleSetEnabled,
PublisherName = this.PublisherName,
Type = this.Type,
Version = this.Version
};

WriteObject(images, true);
WriteObject(image);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();

WriteWarning(Properties.Resources.DeprecationOfGetAzureVMExtensionImageDetail);

var parameters = new VirtualMachineExtensionImageGetParameters
{
Location = Location.Canonicalize(),
Expand Down
Loading