/// <summary> /// Executes the operations associated with the cmdlet. /// </summary> 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()); } }