Link to home
Start Free TrialLog in
Avatar of Pete
PeteFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Run command line command in powersehll

A simple question, what's the best was to run a command line command in powershell?

In my .ps1 script after a load of powershell commands I want to run a line:

Rundll printuientry.....etc

Do I use invoke command or invoke expression or something else?

Thanks
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

I would first look for a native Powershell command.

For example, there are better ways to automate printer without use rundll32 printui.dll,printUIEntry

After that, I prefer to use System.Diagnostics.Process mainly because I develop in .NET
$process = New-Object System.Diagnostics.Process

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

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