About
Pricing
Community
Teams
Start Free Trial
Log in
Pete
asked on
5/25/2018
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
Powershell
2
1
Last Comment
oBdA
8/22/2022 - Mon
Shaun Vermaak
5/26/2018
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
Select all
Open in new window
ASKER CERTIFIED SOLUTION
oBdA
5/26/2018
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
For example, there are better ways to automate printer without use rundll32 printui.dll,printUIEntry
After that, I prefer to use System.Diagnostics.Process
Open in new window