Click here to Skip to main content
15,881,757 members
Home / Discussions / C#
   

C#

 
GeneralRe: About Async Event Pin
Super Lloyd20-Jul-16 2:08
Super Lloyd20-Jul-16 2:08 
GeneralRe: About Async Event Pin
Richard Deeming19-Jul-16 1:54
mveRichard Deeming19-Jul-16 1:54 
GeneralRe: About Async Event Pin
Super Lloyd19-Jul-16 2:55
Super Lloyd19-Jul-16 2:55 
QuestionHow can I run multiple powershell commands in a C#/powershell runspace? Pin
turbosupramk318-Jul-16 4:02
turbosupramk318-Jul-16 4:02 
QuestionRe: How can I run multiple powershell commands in a C#/powershell runspace? Pin
Richard MacCutchan18-Jul-16 4:22
mveRichard MacCutchan18-Jul-16 4:22 
AnswerRe: How can I run multiple powershell commands in a C#/powershell runspace? Pin
turbosupramk318-Jul-16 4:35
turbosupramk318-Jul-16 4:35 
GeneralRe: How can I run multiple powershell commands in a C#/powershell runspace? Pin
Richard MacCutchan18-Jul-16 4:51
mveRichard MacCutchan18-Jul-16 4:51 
GeneralRe: How can I run multiple powershell commands in a C#/powershell runspace? Pin
turbosupramk318-Jul-16 4:58
turbosupramk318-Jul-16 4:58 
I should have removed the command1 and command2, those were just additional ways of me trying the same thing. Sorry about that.

Error message is

Quote:
- The term 'Import-Module' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. - System.Management.Automation - at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke(IEnumerable input) at System.Management.Automation.RemotePipeline.Invoke(IEnumerable input) at System.Management.Automation.Runspaces.Pipeline.Invoke() at exchangePictureUpdater.exchangePictureUpdater.btnAddReplace_Click(Object sender, EventArgs e) - Void CoreInvoke[TOutput](System.Collections.IEnumerable, System.Management.Automation.PSDataCollection`1[TOutput], System.Management.Automation.PSInvocationSettings) |


C#
Command command1 = new Command("set-adserversettings");
CommandParameter parameter1 = new CommandParameter("viewentireforest", true);
command1.Parameters.Add(parameter1);

Command command2 = new Command("set-userphoto");
CommandParameter parameter2a = new CommandParameter("identity", tbxName.Text);
CommandParameter parameter2b = new CommandParameter("picturedata", displayedImage);
CommandParameter parameter2c = new CommandParameter("domaincontroller", "adfadfadf.com");
CommandParameter parameter2d = new CommandParameter("confirm", false);
command2.Parameters.Add(parameter2a);
command2.Parameters.Add(parameter2b);
command2.Parameters.Add(parameter2c);
command2.Parameters.Add(parameter2d);

Pipeline pipeline = runspacee.CreatePipeline();

pipeline.Commands.Add(command1);
pipeline.Commands.Add(command2);

GeneralRe: How can I run multiple powershell commands in a C#/powershell runspace? Pin
Richard MacCutchan18-Jul-16 6:15
mveRichard MacCutchan18-Jul-16 6:15 
GeneralRe: How can I run multiple powershell commands in a C#/powershell runspace? Pin
turbosupramk318-Jul-16 7:49
turbosupramk318-Jul-16 7:49 
GeneralRe: How can I run multiple powershell commands in a C#/powershell runspace? Pin
turbosupramk319-Jul-16 4:10
turbosupramk319-Jul-16 4:10 
QuestionClose Form Popup before opening MessageBox.Show and the form use delegate ? Pin
Member 245846717-Jul-16 22:47
Member 245846717-Jul-16 22:47 
AnswerRe: Close Form Popup before opening MessageBox.Show and the form use delegate ? Pin
OriginalGriff17-Jul-16 22:51
mveOriginalGriff17-Jul-16 22:51 
Questionc# parser questions. Pin
elfenliedtopfan517-Jul-16 13:13
elfenliedtopfan517-Jul-16 13:13 
AnswerRe: c# parser questions. Pin
OriginalGriff17-Jul-16 21:42
mveOriginalGriff17-Jul-16 21:42 
GeneralRe: c# parser questions. Pin
elfenliedtopfan518-Jul-16 3:31
elfenliedtopfan518-Jul-16 3:31 
GeneralRe: c# parser questions. Pin
OriginalGriff18-Jul-16 4:11
mveOriginalGriff18-Jul-16 4:11 
GeneralRe: c# parser questions. Pin
elfenliedtopfan518-Jul-16 7:24
elfenliedtopfan518-Jul-16 7:24 
GeneralRe: c# parser questions. Pin
OriginalGriff18-Jul-16 8:02
mveOriginalGriff18-Jul-16 8:02 
GeneralRe: c# parser questions. Pin
elfenliedtopfan518-Jul-16 9:28
elfenliedtopfan518-Jul-16 9:28 
GeneralRe: c# parser questions. Pin
OriginalGriff18-Jul-16 9:33
mveOriginalGriff18-Jul-16 9:33 
GeneralRe: c# parser questions. Pin
elfenliedtopfan518-Jul-16 10:31
elfenliedtopfan518-Jul-16 10:31 
QuestionContextMenu on a MenuItem in ContextMenu possible in WPF? Pin
Imagiv16-Jul-16 4:08
Imagiv16-Jul-16 4:08 
QuestionRe: ContextMenu on a MenuItem in ContextMenu possible in WPF? Pin
User 1106097916-Jul-16 7:53
User 1106097916-Jul-16 7:53 
AnswerRe: ContextMenu on a MenuItem in ContextMenu possible in WPF? Pin
Imagiv18-Jul-16 1:19
Imagiv18-Jul-16 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.