Skip to content

Commit 824059f

Browse files
committed
Merge branch 'preview' of https://github.com/Azure/azure-powershell into preview1
2 parents 10a8fe7 + d224327 commit 824059f

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/ResourceManager/AnalysisServices/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Remove validate set of location into dynamic lookup so that all clouds are supported.
2122

2223
## Version 0.5.0
2324
* Fixed Synchronize-AzureAsInstance command to work with new AsAzure REST API for sync

src/ResourceManager/AnalysisServices/Commands.AnalysisServices/Commands/NewAzureRmAnalysisServicesServer.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ public class NewAnalysisServicesServer : AnalysisServicesCmdletBase
4141
[Parameter(ValueFromPipelineByPropertyName = true, Position = 2, Mandatory = true,
4242
HelpMessage = "Azure region where the server should be created.")]
4343
[ValidateNotNullOrEmpty]
44-
[ValidateSet("North Central US", "South Central US", "Central US", "West Europe", "North Europe", "West US",
45-
"East US",
46-
"East US 2", "Japan East", "Japan West", "Brazil South", "Southeast Asia", "East Asia", "Australia East",
47-
"Australia Southeast", IgnoreCase = true)]
44+
[LocationCompleter("Microsoft.AnalysisServices/servers")]
4845
public string Location { get; set; }
4946

5047
[Parameter(ValueFromPipelineByPropertyName = true, Position = 3, Mandatory = true,

tools/AzureRM.Example.psm1

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ if ($PSVersionTable.PSVersion.Major -ge 5)
1616
$completerCommands = %COMPLETERCOMMANDS%
1717

1818
$completerCommands | ForEach-Object {
19-
$completerObject = New-Object $_.AttributeType -ArgumentList $_.ArgumentList
20-
Register-ArgumentCompleter -CommandName $_.Command -ParameterName $_.Parameter -ScriptBlock {
21-
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
22-
23-
$locations = $completerObject.GetCompleterValues()
24-
$locations | Where-Object { $_ -Like "$wordToComplete*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }
19+
$type = $_.AttributeType
20+
$args = "@()"
21+
if ($_.ArgumentList.Count -ne 0) {
22+
$temp = $_.ArgumentList -join "`", `""
23+
$args = "@(`"" + $temp + "`")"
2524
}
25+
$sb = [scriptblock]::Create("param(`$commandName, `$parameterName, `$wordToComplete, `$commandAst, `$fakeBoundParameter) `
26+
`$completerObject = New-Object $type -ArgumentList $args `
27+
`$arguments = `$completerObject.GetCompleterValues() `
28+
`$arguments | Where-Object { `$_ -Like `"`$wordToComplete*`" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new(`$_, `$_, 'ParameterValue', `$_) }")
29+
Register-ArgumentCompleter -CommandName $_.Command -ParameterName $_.Parameter -ScriptBlock $sb
2630
}
2731
}
2832

0 commit comments

Comments
 (0)