Solved

Command Prompt vs the PowerShell

Posted on 2010-09-16
2
2,056 Views
Last Modified: 2012-05-10
Hello,

I am a DOS die-hard and have been reluctant to abandon it. I was just performing some tests in PowerShell 2.0 and found that I can run all the regular DOS commands inside Powershell. Is this a problem or is this a feature of PowerShell? What are the benefits of running PowerShell verses MS DOS? Does it handle memory better, etc? I have a lot of batch scripts that I run in DOS. Should I expect any problems running DOS batch scripts in Powershell? I would appreciate feedback on this.

Thanks,
John
0
Comment
Question by:jhieb
2 Comments
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 33695362
PS
- needs longer to start.
+ allows for direct .NET (and other) object access, as in WSH
+ 2.0 allows for remote code execution, making WMI and WSH superfluous.
+ can run most of the DOS prompt commands
+ has a job management system, so you can run background jobs, and collect and process the output

As processing is always done via objects, you have attributes you can sort on, format, filter, and many more. Even flat files can be handled the same way.

IMO you need some time to make yourself comfortable with the syntax and features, but it pays. I would, however, not convert existing batch files without need. I'm still hesitant myself, but I see the power of that shell. There is a good article here at http:/A_3296-The-Absolute-Beginner's-Guide-to-Powershell.html which explains some basics for dummies, and is a good introduction where that power lies.

And don't forget the Command Prompt features are not that reliable. To see some side effects and bugs you might want to read http:/A_673-Advanced-DOS-batch-pitfalls.html .
0
 
LVL 1

Author Closing Comment

by:jhieb
ID: 33696654
Thank you. This is very good information and the references are also good resources.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question