Solved

Command Prompt vs the PowerShell

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

778 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