示例#1
0
        public static Client15Connector CreateClientConnector(string siteUrl,
                                                              PSCredential credential, SwitchParameter cloudCredential, AppLog appLog)
        {
            Client15Connector clientConnector = new Client15Connector(siteUrl);

            if (credential != null)
            {
                if (cloudCredential.IsPresent)
                {
                    clientConnector.SetCredentialsForCloud(credential.UserName, credential.Password,
                                                           (message) => { appLog.WriteVerbose(message); }
                                                           );
                }
                else
                {
                    clientConnector.SetCredentialsForOnPrem(credential.UserName, credential.Password);
                }
            }
            else
            {
                if (cloudCredential.IsPresent)
                {
                    throw new InvalidOperationException(
                              "The -CloudCredential switch cannot be used without specifying a credential object");
                }
            }
            return(clientConnector);
        }
 public ExportTaxmlCommand()
 {
     this.AppLog = new AppLog(this);
 }
示例#3
0
 public ConvertCsvToTaxmlCommand()
 {
     this.AppLog = new AppLog(this);
 }