in src/PowerShell/Commands/RegisterPartnerTokenCache.cs [39:65]
public override void ExecuteCmdlet()
{
string inMemoryControlFilePath = Path.Combine(SharedUtilities.GetUserRootDirectory(), ".PartnerCenter", "InMemoryTokenCache");
// TODO - Need to clone the cache if already connected; otherwise, the user will need to connect.
if (InMemory.IsPresent && InMemory.ToBool())
{
if (!File.Exists(inMemoryControlFilePath))
{
Directory.CreateDirectory(Path.GetDirectoryName(inMemoryControlFilePath));
File.Create(inMemoryControlFilePath).Dispose();
}
PartnerSession.Instance.RegisterComponent(ComponentKey.TokenCache, () => new InMemoryTokenCache(), true);
}
if (Persistent.IsPresent && Persistent.ToBool())
{
if (File.Exists(inMemoryControlFilePath))
{
File.Delete(inMemoryControlFilePath);
}
PartnerSession.Instance.RegisterComponent(ComponentKey.TokenCache, () => new PersistentTokenCache());
}
}