PowerShell commands
Windows PowerShell is a command line shell program and script environment that allows command line users and script writers to take advantage of the powerful functions of. NET Framework. It introduces many useful new concepts to further expand your knowledge and scripts created in the Windows Command Prompt and Windows Script Host environment.
Start PowerShell and enter several common Cmd commands.
PS D:\Projects\Practise\PowerShell> dir Directory: D:\Projects\Practise\PowerShellMode LastWriteTime Length Name---- ------------- ------ ----d---- 1/23/2013 12:35 PM d1d---- 1/23/2013 12:35 PM d2-a--- 1/21/2013 8:38 PM 36314 alias.txt-a--- 1/21/2013 8:32 PM 241530 cmdlets.txt
Or
PS D:\Projects\Practise\PowerShell> cd ..PS D:\Projects\Practise>
The results are similar to our expectation. However, can we say that PowerShell is the enhanced version of command line? Try the following command again:
PS D:\Projects\Practise\PowerShell> dir /addir : Cannot find path 'D:\ad' because it does not exist.
...
This is far from our expectation. In Cmd, it should output information about the subfolders in the current position, but here, it does not seem to understand our parameters. The following command is the same:
PS D:\Projects\Practise\PowerShell> fc .\alias.txt .\cmdlets.txtFormat-Custom : A positional parameter cannot be found that accepts argument '.\cmdlets.txt'.
...
I originally wanted to call the fc command to compare two files, but it understood it as Format-Custom. What's the problem? Here we can answer the first two questions: PowerShell cannot execute all commands of the Cmd command line. To be exact, PowerShell cannot execute any Cmd command, at least not directly. This is because PowerShell is not a new or enhanced version of Cmd, but some of its commands have similar functions as Cmd commands.