public async Task <bool> DeleteDirectory(string directoryPath) { await _scriptWrapperBool.Run("Remove-Item", new Dictionary <string, dynamic> { { "LiteralPath", directoryPath }, { "Force", null }, { "Recurse", null } }); return(!_scriptWrapperBool.Errors.Any()); }
public async Task <bool> CreateDirectory(string directoryPath) { await _scriptWrapperDirectory.Run("New-Item", new Dictionary <string, dynamic> { { "ItemType", "directory" }, { "Path", directoryPath } }); return(_scriptWrapperDirectory.Results.Any()); }
public async Task <string> GetHashMd5(string kernelPath) { var parameters = new Dictionary <string, dynamic> { { "Filepath", kernelPath } }; await _scriptWrapper.Run(Modules.Functions.GetHashMD5, parameters); return(_scriptWrapper.Results.FirstOrDefault()); }
public async Task <bool> SaveToFile(BackupInfo backupInfo) { var parameters = new Dictionary <string, dynamic> { { "xml", backupInfo.Serialize().ToString() }, { "OutputFile", $@"{backupInfo.Webroot}\{Settings.BackupInfoFile}" } }; await _scriptWrapper.Run(Modules.Functions.SaveBackupInfo, parameters); return(true); }
public async Task <IEnumerable <KeyValuePair <string, string> > > GetBindings(string siteName) { await _scriptWrapper.Run(Modules.Functions.GetBindings, new Dictionary <string, dynamic> { { "SiteNameOrPath", siteName } }); return(_scriptWrapper.Results); }
public async Task <string> ReadUrlContent(string url) { var parameters = new Dictionary <string, dynamic> { { "Webroot", _profile.Webroot }, { "RelativeUrl", url } }; await _scriptWrapper.Run(Modules.Functions.ReadUrlContent, parameters); return(string.Join("\r\n", _scriptWrapper.Results)); }
private async Task TestRemote(object sender, EventArgs <IRemoteSettings> e) { var profile = ProfilesService.CreateProfile(e.Value); _scriptWrapper = new ScriptWrapper <string>(profile, _view, d => d.ToString()); await _scriptWrapper.Run("dir"); if (_scriptWrapper.Results.Any()) { _displayMessage.ShowInfo("Success", "Your connection details are valid."); } if (_scriptWrapper.Errors.Any() && _scriptWrapper.Errors.First() is RemoteTimeoutException) { _displayMessage.ShowError("Connection Error", "Falied to connect to remote machine with specified parameters"); } _view.ToggleTestButton(true); }
public async Task <Dictionary <string, DriveType> > GetDrives() { await _scriptWrapperDrive.Run(Modules.Functions.GetDrives); return(_scriptWrapperDrive.Results.ToDictionary(d => d.Name, d => d.DriveType)); }
public async Task <IEnumerable <string> > GetSitecoreSites() { await _scriptWrapperString.Run(Modules.Functions.GetSitecoreSites); return(_scriptWrapperString.Results); }