question

Rachel-7376 avatar image
0 Votes"
Rachel-7376 asked Viorel-1 commented

Run Powershell command C# in all platforms

Hi,
I want to run power shell command on a simple console app.
I'm running on x64 platform.
As I'm running with AnyCpu option it doesn't work.
I'm getting error pnputil : The term 'pnputil' is not recognized as the name of a cmdlet,
If i'm running with x64 option it works.
How can I run the application so it'll work on platforms? (e.g on x32 , x64)

Thank You.






dotnet-csharpwindows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Viorel-1 avatar image
0 Votes"
Viorel-1 answered Viorel-1 commented

When you set the "Any CPU" platform, also try unchecking the "Prefer 32-bit" option in Project Properties window.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Working , thank you! will it work on x86 too?

0 Votes 0 ·

Theoretically it should work.


0 Votes 0 ·