Solved

Command Prompt vs the PowerShell

Posted on 2010-09-16
2
2,043 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 68

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
This article will help you understand what HashTables are and how to use them in PowerShell.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now