Using C# to execute PowerShell script with command line args using V2 methods

前端 未结 1 1367
[愿得一人]
[愿得一人] 2020-12-10 15:32

I am writing an C# application which will need to execute Powershell scripts with command line arguments and retrieve the output (aka what I would expect to see in the outpu

相关标签:
1条回答
  • 2020-12-10 16:01

    Answering my own question here. It looks like the right approach would be for my application to function as a PowerShell Host

    https://msdn.microsoft.com/en-us/library/ee706563(v=vs.85).aspx

    Use of PowerShell V2 objects is defined here: http://msdn.microsoft.com/en-us/library/windows/desktop/system.management.automation.powershell(v=vs.85).aspx

    0 讨论(0)
提交回复
热议问题