protected override void ProcessRecord() { if (ApiVersion == null) { ApiVersion = Resources.DefaultApiVersion; } if (Domain == null) { Domain = Resources.DefaultApiDomain; } if (Account == null) { Account = Resources.DefaultGlobalApiSubdomain; } if (Provider == null) { Provider = Resources.ShareFileProvider; } var authDomain = new AuthenticationDomain() { Account = Account, Domain = Domain, ApiVersion = ApiVersion, Provider = Provider }; authDomain.Credential = Credential != null?Credential.GetNetworkCredential() : null; PSShareFileClient psc = new PSShareFileClient(Name, authDomain); psc.GetSession(); WriteObject(psc); }
public WebDialogThread(PSShareFileClient psClient, AuthenticationDomain domain, Uri formUri = null, Uri tokenUri = null, string root = null) { _psClient = psClient; _requestDomain = domain; _formUri = formUri; _tokenUri = tokenUri; _root = root; }
protected override void ProcessRecord() { if (Name.IndexOf('.') < 0) Name += ".sfps"; var psc = new PSShareFileClient(Name); psc.Load(); try { psc.Client.Sessions.Get().Execute(); } catch (WebAuthenticationException) { psc = new PSShareFileClient(Name); psc.Load(); psc.Client.Sessions.Get().Execute(); } WriteObject(psc); }
protected override void ProcessRecord() { if (ApiVersion == null) ApiVersion = Resources.DefaultApiVersion; if (Domain == null) Domain = Resources.DefaultApiDomain; if (Account == null) Account = Resources.DefaultGlobalApiSubdomain; if (Provider == null) Provider = Resources.ShareFileProvider; var authDomain = new AuthenticationDomain() { Account = Account, Domain = Domain, ApiVersion = ApiVersion, Provider = Provider, Username = Email }; authDomain.Credential = Credential != null ? Credential.GetNetworkCredential() : null; PSShareFileClient psc = new PSShareFileClient(Name, authDomain); psc.GetSession(); WriteObject(psc); }
protected override void ProcessRecord() { if (Name.IndexOf('.') < 0) { Name += ".sfps"; } var psc = new PSShareFileClient(Name); psc.Load(); try { psc.Client.Sessions.Get().Execute(); } catch (WebAuthenticationException) { psc = new PSShareFileClient(Name); psc.Load(); psc.Client.Sessions.Get().Execute(); } WriteObject(psc); }
public WebDialogThread(PSShareFileClient psClient, AuthenticationDomain domain) { _psClient = psClient; _requestDomain = domain; }