Link to home
Start Free TrialLog in
Avatar of gateguard
gateguard

asked on

How to call powershell from c++

For dos commands I use system(doscommand) in c++

What can I use for powershell cmdlets in c++

thanks
Avatar of Chris Wong
Chris Wong
Flag of Hong Kong image

Avatar of gateguard
gateguard

ASKER

Thanks but I'm looking for something more concrete.

Like I said, to run dos commands in c++ ... system(doscommand)

To run powershell cmdlets in c++ ... ???

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't see it there.

I'm working with using calling powershell from the system() command.
Using system() for calling PS is very primitive, and cuts you out of any advanced result processing. But if you wish ... Just call
  powershell.exe -NoLogo c:\temp\script.ps1