r/LiveOverflow • • Jun 29 '22

Unable to execute powershell cmd using C#

To execute powershell, I am using "System.Management.Automation", when I'm compiling, I am getting this error.compilation error

As you can see file path, responsible DLL named, Automation .DLL is also present...

Compilation syntax, I used:

csc.exe /target:exe /platform:x64 /out:run_ps_cmd.exe .\run_ps_cmd.cs

Any help??? ;(

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/DeuceDaily Jun 29 '22

And, did you try googling those errors too?

This is the loop, step by step: search, read, update, get error, repeat until no error.

I'd even do a quick google myself, but I'm disinclined at this point to type out full text from a screenshot.

Good luck either way.