SoFunction
Updated on 2025-03-10

PowerShell Introduction Basic Tutorial

Windows PowerShell is a new Windows command line shell designed for system administrators. The shell includes interactive prompts and scripting environments, both of which can be used independently or in combination.

Now win2008 and win7 are integrated with PowerShell. The system can download and install it by yourself without PowerShell.
Download address:https:///jiaoben/

Interpretation:

1. What are interactive tips?
Answer: An interactive prompt is like opening a cmd window and executing a ping command inside, which will dynamically input the result. It can also be like executing the ftp command, with a context environment (Context) that can interact.
2. What is a script environment?
Answer: Just like writing a VBScript script, write down PowerShell's program statements in the form of a file, and then use the PowerShell's script environment to execute the entire script file. By the way, batch processing can also be understood as a scripting environment. The PowerShell script file has an extension of .ps1, and the language supports language structures for loops, conditions, flow control, and variable assignment.

Windows PowerShell is a new Windows command line shell designed for system administrators. The shell includes interactive prompts and scripting environments, both of which can be used independently or in combination.

Interpretation:

1. What are interactive tips?
Answer: An interactive prompt is like opening a cmd window and executing a ping command inside, which will dynamically input the result. It can also be like executing the ftp command, with a context environment (Context) that can interact.
2. What is a script environment?
Answer: Just like writing a VBScript script, write down PowerShell's program statements in the form of a file, and then use the PowerShell's script environment to execute the entire script file. By the way, batch processing can also be understood as a scripting environment. The PowerShell script file has an extension of .ps1, and the language supports language structures for loops, conditions, flow control, and variable assignment.

Unlike most shells that accept and return text, Windows PowerShell is built on 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 to manage and configure Windows.
Interpretation:
This is very interesting. It is not surprising that an objectized scripting environment is an objectized interactive environment. It is indeed a brand new concept.

Windows PowerShell introduced the concept of cmdlets (pronounced as "command-let"), a simple single-function command line tool built into the shell. Each cmdlet can be used separately, but it only works when using these simple tools in combination to perform complex tasks. Windows PowerShell includes over a hundred basic core cmdlets that you can write your own cmdlets and share with other users.

Interpretation:

1. This should be similar to the built-in commands such as dir, cd, copy, and del, but it can be modularly added and deleted. PowerShell comes with a large number of cmdlets, which can also be written and distributed by yourself.
2. The cmdlet can be identified by its name format -- verbs and nouns separated by dash (-), such as Get-Help, Get-Process and Start-Service. With Start-Service, there are Stop-Service and Restart-Service. Here, the Windows system's customary style of not distinguishing between command sizes is reflected.
3. The function of each cmdlet is very simple. For example, the "get" cmdlet only retrieves data, the "set" cmdlet only creates or changes data, the "format" cmdlet only sets the data format, and the "out" cmdlet only directs the output to the specified target, so you should pay attention to how to use it in combination.
4. Each cmdlet has a help file, which can be accessed by typing the following content: get-help <cmdlet name> -detailed. If you only want to view simple information, don't specify the parameter. If you want to view more comprehensive technical information, you need to change detailed to full.
You can also use help <cmdlet name> directly, or use <cmdlet name> -? directly.
get-help * can display all Powershell commands. get-help get-* can display commands starting with get.
Trying to read get-help start-service -full in full will have a shocking understanding of PowerShell.
5. Many cmdlets have built-in alias, such as the alias of Get-Service is gsv;
6. Get-Command, you can list all cmdlets;

Windows PowerShell provides you with access to the file system on your computer. Additionally, using Windows PowerShell providers, you can access other data stores, such as registry and digital signature certificate stores, as easy as accessing a file system.
Interpretation:

1. OK, its strengths lie in file systems, registry, digital certificates, etc.? As you learn more, you will also be exposed to its more powerful functions.

You can run Windows command-line programs in Windows PowerShell and you can start Windows programs with graphical user interfaces (such as Notepad and Calculator) in the shell. You can also capture the text generated by the program and use it in the shell (very similar to that in ).

Interpretation:

1. External commands that can be executed inside, such as,,, etc., can be used normally in PowerShell;
2. It can also be used in PowerShell;
3. The built-in commands can also be used, such as dir c:;
4. You can open the service panel when running;
5. You can also open a Windwos program with a graphical interface like this.