Exemple #1
0
        public AbstractCmdletTest()
        {
            _pwrSh = System.Management.Automation.PowerShell.Create();
            // Import Module
            _pwrSh.AddCommand("import-module");
            _pwrSh.AddParameter("Name", "./Sentral.Api.PowerShell.dll");
            _pwrSh.Invoke();
            _pwrSh.Commands.Clear();


            var settings = TestSettings.LoadSettings();

            try
            {
                ConnectSentralApi.GetSentralAPIConnection();
            }
            catch
            {
                var connection = new ConnectSentralApi()
                {
                    BaseUrl    = settings.BaseUrl,
                    ApiKey     = settings.ApiKey,
                    TenantCode = settings.ApiTenant
                };

                var enumerator = connection.Invoke().GetEnumerator();

                while (enumerator.MoveNext())
                {
                }
            }


            _isTestSite = settings.BaseUrl.Contains(".sentral.school/");
        }
Exemple #2
0
 public SentralPSCmdlet()
 {
     SentralApiClient = ConnectSentralApi.GetSentralAPIConnection();
 }