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/"); }
public SentralPSCmdlet() { SentralApiClient = ConnectSentralApi.GetSentralAPIConnection(); }