Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
124 views
by Master (1.2k points)

1 Answer

0 like 0 dislike
by Contributing Tester (99 points)

The simple answer is that PowerShell is object-oriented, and cmd.exe is string-based.  But that's glossing over the "why is this not just different, but BETTER?", which is the underlying question.

PSH can create .NET objects on the shell and allow the user to interact with them.  

I can, interactively, open an XML file, browse into it using DOM (ParentNode.ChildNode.ChildNode.Attribute), using XPath (SelectSingleNode("//host"), or [XML] class methods (GetParentNode()), edit it with $xml.CreateElement()/$node.AppendChild(), save it, and fire up in Visual Studio.  Interactively.

Normally, I would have to write a program to do it, compile it, run it, (wait for it to bomb out), and then manually open the file in VS.

I can write a script to fire up a new Internet Explorer, have it navigate to a URL, then start filling out fields in forms and expand dynamic content (with great difficulty)  using COM automation.  Or do the same thing in Excel - take a CSV file, dump it into Excel, reformat it (this table style, add these formulas, that column width) and save it.

I can resize the console window.  Or change the title.  Or increase the buffer (really?  Only 300 lines by default?)  Or copy the contents of the buffer, complete with colors.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...