locked
Running powershell scripts from C# app RRS feed

  • Question

  • Hi,

    I have a bunch of powershell scripts to query SCCM for info and return it to a C# application. My first script call always works fine but any additional scripts will fail. I tried running them in sequence from a powershell prompt which works fine. I tried removing the module at the end of each script and I also tried creating a new runspace with each script but that didn't work. Has anyone else run into a similar issue?

    Thanks!


    Wednesday, March 2, 2016 8:01 PM

Answers

  • Dear Sir,

    For my own, I'm not a programmer and never tried that. But it sounds that it's more like a PowerShell question, isn't it? If I'm not mistaken, I suggest to post to PowerShell Forum, there are many scripting pros.

    PowerShell Forum link:

    https://social.technet.microsoft.com/Forums/windowsserver/en-Us/home?forum=winserverpowershell

    Best regards

    Frank


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Proposed as answer by Frank Dong Tuesday, March 22, 2016 8:04 AM
    • Marked as answer by Frank Dong Thursday, March 24, 2016 7:50 AM
    Thursday, March 3, 2016 2:43 AM

All replies

  • Dear Sir,

    For my own, I'm not a programmer and never tried that. But it sounds that it's more like a PowerShell question, isn't it? If I'm not mistaken, I suggest to post to PowerShell Forum, there are many scripting pros.

    PowerShell Forum link:

    https://social.technet.microsoft.com/Forums/windowsserver/en-Us/home?forum=winserverpowershell

    Best regards

    Frank


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Proposed as answer by Frank Dong Tuesday, March 22, 2016 8:04 AM
    • Marked as answer by Frank Dong Thursday, March 24, 2016 7:50 AM
    Thursday, March 3, 2016 2:43 AM
  • That question is way too general. You would have to provide an example and error message.

    Torsten Meringer | http://www.mssccmfaq.de

    Thursday, March 3, 2016 6:55 AM