Solved

Command Prompt vs the PowerShell

Posted on 2010-09-16
2
2,067 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 70

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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