Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
34422d8
adding warning when not using latest image version when creading vmss
grizzlytheodore Jun 30, 2020
d6f4cc5
update to tabified file
grizzlytheodore Jun 30, 2020
7f354e7
add missing bracket
grizzlytheodore Jul 1, 2020
7563ac9
remove new lines from Get-Content call
grizzlytheodore Jul 1, 2020
197de25
minor fixes
grizzlytheodore Jul 1, 2020
8748d8c
using assert-true method
grizzlytheodore Jul 1, 2020
ccfe150
removing some commmented out code
grizzlytheodore Jul 2, 2020
84b2435
align
grizzlytheodore Jul 2, 2020
6d7408e
indent
grizzlytheodore Jul 2, 2020
271b958
newline at the end
grizzlytheodore Jul 2, 2020
cd68271
Update ChangeLog.md
VeryEarly Jul 3, 2020
a02111d
Merge branch 'master' of https://github.com/Azure/azure-powershell
grizzlytheodore Jul 6, 2020
abdb1f9
add location parameter to get-azcomputeresourcesku
grizzlytheodore Jul 7, 2020
572eab5
Merge branch 'master' of https://github.com/grizzlytheodore/azure-pow…
grizzlytheodore Jul 7, 2020
c5b86ea
add help file
grizzlytheodore Jul 7, 2020
8aa45b1
update changelog.md
grizzlytheodore Jul 7, 2020
00d1100
review update
grizzlytheodore Jul 7, 2020
d965ae9
Update ChangeLog.md
wyunchi-ms Jul 8, 2020
6a8a288
review fixes
grizzlytheodore Jul 9, 2020
4525afe
Merge branch 'master' of https://github.com/grizzlytheodore/azure-pow…
grizzlytheodore Jul 9, 2020
eeb0645
Merge branch 'master' of https://github.com/Azure/azure-powershell
grizzlytheodore Jul 14, 2020
39857bc
test commit
grizzlytheodore Jul 15, 2020
9b3201d
undo test
grizzlytheodore Jul 15, 2020
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
7 changes: 7 additions & 0 deletions src/Compute/Compute.Test/ScenarioTests/ResourceSkuTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,12 @@ public void TestGetResourceSku()
{
TestRunner.RunTestScript("Test-GetResourceSku");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetResourceSkuByLocation()
{
TestRunner.RunTestScript("Test-GetResourceSkuByLocation");
}
}
}
10 changes: 10 additions & 0 deletions src/Compute/Compute.Test/ScenarioTests/ResourceSkuTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@ function Test-GetResourceSku
Assert-True { $output.Contains("virtualMachines"); }
Assert-True { $output.Contains("Zones"); }
}

<#
.SYNOPSIS
Test List Resource Skus by Location
#>
function Test-GetResourceSkuByLocation
{
$skulist = Get-AzComputeResourceSku "westus" | where {$_.Locations -eq "eastus"};
Assert-True { $skulist.Count -eq 0; }
}

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

## Version 4.2.1
* Added warning when using `New-AzVmss` without "latest" image version
* Added '-Location' as optional positional parameter to Get-AzComputeResourceSku cmdlet

## Version 4.2.0
* Added SimulateEviction parameter to Set-AzVM and Set-AzVmssVM cmdlets.
Expand Down
20 changes: 18 additions & 2 deletions src/Compute/Compute/Generated/ResourceSku/ResourceSkuListMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,29 @@ namespace Microsoft.Azure.Commands.Compute.Automation
[OutputType(typeof(PSResourceSku))]
public partial class GetAzureRmComputeResourceSku : ComputeAutomationBaseCmdlet
{
[Parameter(
Mandatory = false,
Position = 0,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
[LocationCompleter("Microsoft.Compute/locations/publishers")]
public string Location { get; set; }

public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();
ExecuteClientAction(() =>
{

var result = ResourceSkusClient.List();
Microsoft.Rest.Azure.IPage<ResourceSku> result;
if (this.IsParameterBound(c => c.Location))
{
string filter = String.Format("location eq '{0}'", this.Location);
result = ResourceSkusClient.List(filter);
}
else
{
result = ResourceSkusClient.List();
}
var resultList = result.ToList();
var nextPageLink = result.NextPageLink;
while (!string.IsNullOrEmpty(nextPageLink))
Expand Down
21 changes: 18 additions & 3 deletions src/Compute/Compute/help/Get-AzComputeResourceSku.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ List all compute resource Skus
## SYNTAX

```
Get-AzComputeResourceSku [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
Get-AzComputeResourceSku [[-Location] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -23,7 +23,7 @@ List all compute resource Skus

### Example 1
```
PS C:\> PS C:\> Get-AzComputeResourceSku | where {$_.Locations.Contains("westus")};
PS C:\> Get-AzComputeResourceSku "westus";
```

List all compute resource skus in West US region
Expand All @@ -45,12 +45,27 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Location
Specifies a location of the available skus to list.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### None
### System.String

## OUTPUTS

Expand Down