functions/private/Register-AutoCompleter.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function Register-AutoCompleter {

    function StorageType {
    param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
    $ARM = ((invoke-webrequest -Uri $function:TemplateUrl -UseBasicParsing).Content)|ConvertFrom-Json
    $ARM.Parameters.StorageType.AvailableValues|?{$_ -like "$wordToComplete*"}|%{new-completionresult -completionresult $_}
          
            
          

 
}

Register-AutoCompleter -CommandName New-FlexdeskAzureDeployment -Parameter StorageType -ScriptBlock function:StorageType -Description "Azure Storage Type"
}