AWSSAML.SetAWSSAMLCredentials.SetPowershellSamlProfile C# (CSharp) Метод

SetPowershellSamlProfile() приватный Метод

private SetPowershellSamlProfile ( ImmutableCredentials awsSessionCredentials ) : void
awsSessionCredentials Amazon.Runtime.ImmutableCredentials
Результат void
        private void SetPowershellSamlProfile(ImmutableCredentials awsSessionCredentials)
        {
            // create a pipeline and feed it the script text
            string script = String.Format("Set-AWSCredentials -AccessKey '{0}' -SecretKey '{1}' -SessionToken '{2}'", awsSessionCredentials.AccessKey, awsSessionCredentials.SecretKey, awsSessionCredentials.Token);

            Runspace theRunSpace = System.Management.Automation.Runspaces.Runspace.DefaultRunspace;

            if (theRunSpace.RunspaceStateInfo.State == RunspaceState.Opened)
            {
                using (Pipeline thePipeline = theRunSpace.CreateNestedPipeline(script, true))
                {
                    Collection<PSObject> theRetVal = thePipeline.Invoke();
                }
            }
        }