Skip to content

Commit f9192e0

Browse files
committed
Represent v1.0-beta profile as beta.
1 parent fe25a05 commit f9192e0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Authentication/Authentication/Cmdlets/SelectMgProfile.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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
{

src/Authentication/Authentication/Models/PSGraphServiceProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)