File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/Authentication/Authentication Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public class SelectMgProfile: PSCmdlet
1919 {
2020 [ Parameter ( Mandatory = true ) ]
2121 [ Alias ( "ProfileName" ) ]
22+ [ ValidateSet ( "v1.0" , "beta" ) ]
2223 [ ValidateNotNullOrEmpty ]
2324 public string Name { get ; set ; }
2425
@@ -32,11 +33,12 @@ protected override void ProcessRecord()
3233 {
3334 if ( this . IsParameterBound ( c => c . Name ) )
3435 {
35- PSModuleInfo [ ] modules = GetModules ( InvokeCommand ) . Where ( m => GetProfiles ( m ) . Contains ( Name ) ) . ToArray ( ) ;
36+ string profileName = Name . ContainsValue ( "beta" , StringComparison . OrdinalIgnoreCase ) ? "v1.0-beta" : Name ;
37+ PSModuleInfo [ ] modules = GetModules ( InvokeCommand ) . Where ( m => GetProfiles ( m ) . Contains ( profileName ) ) . ToArray ( ) ;
3638 string moduleList = string . Join ( ", " , modules . Select ( m => m . Name ) ) ;
3739 if ( ShouldProcess ( $ "Modules { moduleList } ", $ "Load modules with profile { Name } ") )
3840 {
39- GraphSession . Instance . SelectedProfile = Name ;
41+ GraphSession . Instance . SelectedProfile = profileName ;
4042 ReloadModules ( InvokeCommand , modules ) ;
4143 if ( PassThru . IsPresent && PassThru . ToBool ( ) )
4244 {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ internal static PSGraphServiceProfile Create(string name)
3434 {
3535 throw new ArgumentNullException ( nameof ( name ) ) ;
3636 }
37- return new PSGraphServiceProfile { Name = name , Description = GetProfileDescription ( name ) } ;
37+ return new PSGraphServiceProfile { Name = GetProfileVersion ( name ) , Description = GetProfileDescription ( name ) } ;
3838 }
3939
4040 /// <summary>
You can’t perform that action at this time.
0 commit comments