File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
src/Authentication/Authentication/custom Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Set-StrictMode -Version 2
99$scopesParameterBlock = {
1010 param ($commandName ,
1111 $parameterName ,
12- $wordToComplete ,
12+ $wordToCompleteScopes ,
1313 $commandAst ,
1414 $fakeBoundParameters
1515 )
@@ -18,8 +18,25 @@ $scopesParameterBlock = {
1818 $permissionsOAuthQuery = Permissions_GetOauthData (Permissions_GetPermissionsData)
1919 $permissions += $permissionsOAuthQuery.Name
2020 $permissions | Where-Object {
21- $_ -like " $wordToComplete *"
21+ $_ -like " $wordToCompleteScopes *"
2222 }
2323}
2424
25- Register-ArgumentCompleter - CommandName Connect-MgGraph - ParameterName Scopes - ScriptBlock $scopesParameterBlock
25+ $environmentParameterBlock = {
26+ param ($commandName ,
27+ $parameterName ,
28+ $wordToCompleteEnvironment ,
29+ $commandAst ,
30+ $fakeBoundParameters
31+ )
32+
33+ $environments = Get-MgEnvironment | Select-Object - ExpandProperty Name
34+ $environments | Where-Object {
35+ $_ -like " $wordToCompleteEnvironment *"
36+ }
37+ }
38+
39+ Register-ArgumentCompleter - CommandName Connect-MgGraph - ParameterName Scopes - ScriptBlock $scopesParameterBlock
40+ Register-ArgumentCompleter - CommandName Connect-MgGraph - ParameterName Environment - ScriptBlock $environmentParameterBlock
41+
42+ Register-ArgumentCompleter - CommandName Get-MgEnvironment - ParameterName Name - ScriptBlock $environmentParameterBlock
You can’t perform that action at this time.
0 commit comments