@@ -33,24 +33,25 @@ public abstract class AzurePSCmdlet : PSCmdlet
33
33
public AzureProfile Profile { get ; set ; }
34
34
35
35
/// <summary>
36
- /// Determines the current profile - the profile used when no Profile is explicitly passed in. Should only be used by
37
- /// Profile cmdlets and tests that needc to set up a particular profile
36
+ /// Sets the current profile - the profile used when no Profile is explicitly passed in. Should be used only by
37
+ /// Profile cmdlets and tests that need to set up a particular profile
38
38
/// </summary>
39
- public static AzureProfile CurrentProfile {
39
+ public static AzureProfile CurrentProfile
40
+ {
40
41
private get
41
42
{
42
43
if ( _currentProfile == null )
43
44
{
44
45
_currentProfile = InitializeDefaultProfile ( ) ;
45
- UpdateSessionStateForProfile ( _currentProfile ) ;
46
+ SetTokenCacheForProfile ( _currentProfile ) ;
46
47
}
47
48
48
49
return _currentProfile ;
49
50
}
50
51
51
52
set
52
53
{
53
- UpdateSessionStateForProfile ( value ) ;
54
+ SetTokenCacheForProfile ( value ) ;
54
55
_currentProfile = value ;
55
56
}
56
57
}
@@ -70,7 +71,7 @@ static AzurePSCmdlet()
70
71
if ( ! TestMockSupport . RunningMocked )
71
72
{
72
73
InitializeTokenCaches ( ) ;
73
- UpdateSessionStateForProfile ( CurrentProfile ) ;
74
+ SetTokenCacheForProfile ( CurrentProfile ) ;
74
75
AzureSession . DataStore = new DiskDataStore ( ) ;
75
76
}
76
77
}
@@ -114,7 +115,7 @@ protected static void InitializeTokenCaches()
114
115
/// Update the token cache when setting the profile
115
116
/// </summary>
116
117
/// <param name="profile"></param>
117
- protected static void UpdateSessionStateForProfile ( AzureProfile profile )
118
+ protected static void SetTokenCacheForProfile ( AzureProfile profile )
118
119
{
119
120
var defaultProfilePath = Path . Combine ( AzureSession . ProfileDirectory , AzureSession . ProfileFile ) ;
120
121
if ( string . Equals ( profile . ProfilePath , defaultProfilePath , StringComparison . OrdinalIgnoreCase ) )
@@ -162,7 +163,7 @@ protected virtual void InitializeProfile()
162
163
Profile = AzurePSCmdlet . CurrentProfile ;
163
164
}
164
165
165
- UpdateSessionStateForProfile ( Profile ) ;
166
+ SetTokenCacheForProfile ( Profile ) ;
166
167
}
167
168
168
169
/// <summary>
0 commit comments