// Run DSC configuration on server node private void miRunConfiguration_Click(object sender, EventArgs e) { DscServerNode serverNode = (treeLibrary.SelectedNode.Tag as DscServerNode); if (serverNode == null) { return; } string filename = FileSystem.GetTempFile(); File.WriteAllLines(filename, PsCodeBuilder.BuildScript(serverNode.GetConfigurations(), _repository)); PsRunner.Start(filename); }
// Execute Unblock-File on all locked modules in current repository private void UnblockModules() { string[] allFiles = Directory.GetFiles(_repository.Dir.Modules, "*", SearchOption.AllDirectories); List <string> blockedFiles = (from file in allFiles let uri = new Uri(file) let zone = Zone.CreateFromUrl(uri.AbsoluteUri) where zone.SecurityZone != SecurityZone.MyComputer select file).ToList(); if (blockedFiles.Count == 0) { return; } string filename = FileSystem.GetTempFile(); File.WriteAllLines(filename, PsCodeBuilder.BuildUnblockFile(blockedFiles)); PsRunner.Start(filename); }