Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Command Prompt vs the PowerShell

Posted on 2010-09-16
2
Medium Priority
?
2,115 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 71

Accepted Solution

by:
Qlemo earned 2000 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

Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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…

715 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