public async Task InitConnections()
{
WmiInstall.remoteUser = _username;
WmiInstall.remoteComputerName = _computerName;
WmiInstall.remoteDomain = _domain;
WmiInstall.remotePass = _password;
WmiInstall.connectionNamespace = "\\root\\cimv2";
//need to set Powershell info now..
PowershellInstall.remoteUser = _username;
PowershellInstall.remoteComputerName = _computerName;
PowershellInstall.remoteDomain = _domain;
PowershellInstall.remotePass = _password;
ExceptionDispatchInfo exception = null;
try
{
await WmiInstall.InitConnection();
_connectionType = ConnectionType.WMI;
return;
//PowershellInstall.InitConnection();
//_connectionType = ConnectionType.PowerShell;
//return;
}
catch (Exception ex)
{
exception = ExceptionDispatchInfo.Capture(ex);
}
try
{
PowershellInstall.InitConnection();
_connectionType = ConnectionType.PowerShell;
return;
//await WmiInstall.InitConnection();
//_connectionType = ConnectionType.WMI;
//return;
}
catch (Exception ex)
{
exception = ExceptionDispatchInfo.Capture(ex);
}
exception?.Throw();
}