File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/Authentication/Authentication/Cmdlets Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ namespace Microsoft.Graph.PowerShell.Authentication.Cmdlets
1717 [ OutputType ( typeof ( bool ) ) ]
1818 public class SelectMgProfile : PSCmdlet
1919 {
20- [ Parameter ( Mandatory = true ) ]
20+ [ Parameter ( Mandatory = true , Position = 1 ) ]
2121 [ Alias ( "ProfileName" ) ]
2222 [ ValidateSet ( "v1.0" , "beta" ) ]
2323 [ ValidateNotNullOrEmpty ]
@@ -33,10 +33,13 @@ protected override void ProcessRecord()
3333 {
3434 if ( this . IsParameterBound ( c => c . Name ) )
3535 {
36- string profileName = Name . ContainsValue ( "beta" , StringComparison . OrdinalIgnoreCase ) ? "v1.0-beta" : Name ;
36+ string profileName = Name . ToLower ( ) ;
37+ // Internally treat beta profile as v1.0-beta.
38+ // This is an AutoREST limitation.
39+ profileName = profileName . ContainsValue ( "beta" ) ? "v1.0-beta" : profileName ;
3740 PSModuleInfo [ ] modules = GetModules ( InvokeCommand ) . Where ( m => GetProfiles ( m ) . Contains ( profileName ) ) . ToArray ( ) ;
3841 string moduleList = string . Join ( ", " , modules . Select ( m => m . Name ) ) ;
39- if ( ShouldProcess ( $ "Modules { moduleList } ", $ "Load modules with profile { Name } ") )
42+ if ( ShouldProcess ( $ "Modules { moduleList } ", $ "Load modules with profile { profileName } ") )
4043 {
4144 GraphSession . Instance . SelectedProfile = profileName ;
4245 ReloadModules ( InvokeCommand , modules ) ;
You can’t perform that action at this time.
0 commit comments