PowerShell Introductory Basics Tutorial _powershell

Source: Internet
Author: User

Windows PowerShell is a new Windows command-line shell designed for system administrators. The shell includes an interactive hint and scripting environment that can be used either independently or in combination.

Now win2008,win7 are integrated PowerShell, the system without PowerShell can go to the official download installation.
Download Address: http://www.jb51.net/jiaoben/67200.html

Interpretation:

1, what is interactive tips?
A: Interactive prompts are like opening a CMD window and executing a ping command inside it, which dynamically enters the results. You can also have a context, like an FTP command, that you can interact with.
2, what is the scripting environment?
A: Just like writing a VBScript script, write a PowerShell program statement in a file format, and then execute the entire script file with a PowerShell scripting environment. Incidentally, batch processing can also be understood as a scripting environment. The PowerShell script file has a. ps1 extension, which supports language constructs for loops, conditions, flow control, and variable assignment.

Windows PowerShell is a new Windows command-line shell designed for system administrators. The shell includes an interactive hint and scripting environment that can be used either independently or in combination.

Interpretation:

1, what is interactive tips?
A: Interactive prompts are like opening a CMD window and executing a ping command inside it, which dynamically enters the results. You can also have a context, like an FTP command, that you can interact with.
2, what is the scripting environment?
A: Just like writing a VBScript script, write a PowerShell program statement in a file format, and then execute the entire script file with a PowerShell scripting environment. Incidentally, batch processing can also be understood as a scripting environment. The PowerShell script file has a. ps1 extension, which supports language constructs for loops, conditions, flow control, and variable assignment.

Unlike most shell programs that accept and return text, Windows PowerShell is built on the basis of the. NET Common Language runtime (CLR) and the. NET Framework, which accepts and returns. NET objects. This fundamental change in the environment brings new tools and methods for managing and configuring Windows.
Interpretation:
This is interesting, an object-oriented scripting environment is not surprising, an object-oriented interactive environment is indeed a new concept.

Windows PowerShell introduces the concept of a cmdlet (read "Command-let"), which is a simple, single function command-line tool built into the shell. Each cmdlet can be used separately, but the combined use of these simple tools to perform complex tasks works. Windows PowerShell includes more than 100 basic Core cmdlet, and you can write your own cmdlet and share them with other users.

Interpretation:

1, this should be like command with Dir, CD, copy, del These built-in commands are similar, but it can be modular to add, delete. PowerShell has a large number of cmdlet, you can write, distribute.
2. You can recognize the cmdlet by its name format-verbs and nouns separated by dashes (-), such as Get-help, Get-process, and Start-service. There are Start-service Stop-service, Restart-service, where the Windows system does not distinguish the command size of a customary style is embodied.
3. The role of each cmdlet is simple, such as the "Get" cmdlet only retrieves data, the "set" cmdlet only sets up or changes data, the format cmdlet only formats the data, and the "Out" cmdlet directs output only to the specified target. So you should pay attention to how to use the combination.
4. Each cmdlet has a Help file that you can access by typing the following: get-help <cmdlet name >-detailed, if you simply look at the simple information, don't detailed this parameter, if you want to see more comprehensive technical information, You need to change the detailed to full.
You can also use the Help <cmdlet name directly or directly using the <cmdlet name >-? 。
GET-HELP * can display all PowerShell commands. Get-help get-* can display a command that begins with a get.
Try the complete reading Get-help Start-service-full, will have a shocking understanding of PowerShell.
5, many cmdlet has built-in alias, such as Get-service alias is GSV;
6, Get-command, you can list all the cmdlet;

Windows PowerShell provides you with access to the file system on your computer. In addition, using the Windows PowerShell provider, you can access other data stores, such as the registry and the digital signature certificate store, as easily as accessing the file system.
Interpretation:

1, OK, its strength lies in the file system, the registry, digital certificates and so on? With the depth of learning, it will also come into contact with more and more powerful functions.

You can run Windows command-line programs in Windows PowerShell, and you can start Windows programs with a graphical user interface in the shell, such as Notepad and a calculator. You can also capture the text generated by the program and use it in the shell (much like in Cmd.exe).

Interpretation:

1, in the Cmd.exe can be executed outside the command, such as Net.exe, Xcopy.exe, Sc.exe, reg.exe, can be used in the normal PowerShell;
2, Cmd.exe itself can also be used in PowerShell;
3, Cmd.exe built-in commands can also be used, such as Dir c:;
4, running Services.msc can open the service panel;
5, can also open a graphical interface such as Notepad.exe Windwos program.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.