What is Windows PowerShell, what function or function, how to use

Source: Internet
Author: User
Tags object model
Windows 10 era brought a powerful tool to Windows PowerShell. He will be the successor to CMD and become the Next Generation command line tool. This is a command-line interface and scripting language that is designed specifically for system administration. Windows PowerShell makes IT administrators easier to control system management and accelerate automation. The simple command tool (called a cmdlet) in Windows PowerShell allows you to manage computers in your enterprise from the command line. The Windows PowerShell provider makes it easy to access data stores, such as the registry and certificate stores, as you would access the file system. In addition, Windows PowerShell fully supports all Windows Management Instrumentation (WMI) classes. The most important thing is to allow us to expand, to write our own cmdlet, providers, functions, and scripts, and to package them in a module to share with other users.
One, the following changes have been made in Windows PowerShell in Windows:

1 . New cmdlet: contains more than 100 new cmdlet, including Get-hotfix, Send-mailmessage, Get-computerrestorepoint, New-webserviceproxy , Debug-process, Add-computer, Rename-computer, Reset-computermachinepassword and Get-random.

2. Remote management: You can use a command to run commands on a single computer or hundreds of computers. You can establish an interactive session with a single computer. You can also establish a session that can receive remote commands from multiple computers.

3. Windows PowerShell Integrated Scripting Environment (ISE): A graphical user interface that makes it easy to run commands in the same window and compose, edit, run, test, and debug scripts.

4, Background job: use Windows PowerShell background job, you can "in the background" asynchronous run multiple commands, so you can continue to work in the session. You can run a background job on a local or remote computer, and you can store results locally or remotely.
5. Debugger: You can set and remove breakpoints, step through code, check variable values, and display call stack traces.
6, module:Windows PowerShell Module allows Windows PowerShell scripts and functions to be organized into stand-alone units. You can package cmdlet, providers, scripts, functions, and other files into modules that you can distribute to other users. It is more convenient for users to install and use modules than to install and use the Windows PowerShell snap-in. Modules can include any type of file, including audio files, images, help files, and icons. The module runs in a separate session to avoid name collisions.

7. transactions:Windows PowerShell now supports transactions, allowing the management of a set of commands by logical unit. You can commit a transaction, or you can completely undo a transaction so that the transaction does not change the affected data.

8. Events:Windows PowerShell includes a new event infrastructure that allows you to create events, subscribe to system and application events, and then listen, forward, and manipulate events synchronously and asynchronously.
9 Advanced Functions: the Advanced function behaves much like a cmdlet, but is written using the Windows PowerShell scripting language instead of C #.

10. Scripting Internationalization: scripts and functions can display messages and help text to users in multiple languages.

11. online Help: In addition to the Help on the command line, the Get-help cmdlet has a new online parameter that you can use to open a complete, updated version of each Help topic on Microsoft TechNet.
What are the advantages of new and changed features?

In addition to providing many other features, Windows PowerShell provides the following new management features.

Remote Administration: The Windows PowerShell Remote Administration feature enables users to connect to and run Windows PowerShell commands on all their computers. IT professionals can use it to monitor and maintain computers, distribute updates, run scripts and background jobs, collect data, and make unified, optimized changes to a single computer or hundreds of computers.

Windows PowerShell ISE: Windows PowerShell ISE makes it easier and more efficient to use Windows PowerShell. Beginners will be very thankful that the software provides syntax color and context-sensitive help. Multiline editing makes it easy to try to copy content from Help topics and other sources. Advanced users will be glad that software provides multiple execution environments, built-in debuggers, and extensibility of the Windows PowerShell ISE object model.

module: The Windows PowerShell module makes it easier for cmdlet and provider authors to organize and distribute tools and solutions. Also, these modules make it easier for users to install tools and add tools to their Windows PowerShell sessions. IT professionals can use modules to distribute tested and approved solutions in their enterprise, and to share these solutions with other professionals in the community.

transactions: Windows PowerShell transactions enable you to use Windows PowerShell to make changes that may have to be rolled back or committed as a unit (such as database updates and registry changes).
In the use of the process, we have to learn to use Windows PowerShell Help
Windows PowerShell is a new command and Scripting specification, beginners will have a certain sense of strangeness is not easy to get started. In fact, the use of Windows PowerShell Help can help you understand their command specifications as soon as possible.
Third, then to run Windows PowerShell see
To start Windows PowerShell in a Windows 7 system is very simple, click the "Start" button in the bottom of the search box to enter PowerShell, in the search results in the selection of Windows PowerShell can enter the command line mode interface, You can enter the graphics window mode to Windows PowerShell after you select Windows PowerShell V2 ISE. In addition, you can enter PowerShell in the traditional CMD window and press ENTER to run PowerShell.

Entering and executing "Get-command" in PowerShell returns information about the 129 commands provided by Windows PowerShell, which include managing services, processes, event logs, certificates, the registry, and using Windows Management Instrumentation (WMI) and other aspects of system management. If you want to get help on one of these commands, for example, if we want to get help with the command "Get-command", you can execute the command "Get-help Get-command" and get help for other commands like the method.

In addition, to provide you with a number of practical skills. If the command has more help information, one screen is not available channel symbol "|" For a split-screen display, such as "Get-command | More "will display all the Windows PowerShell assemblies on a per-screen basis. The "Get-help get-service-full" will display detailed help for Get-service this assembly, including examples. "Get-help get-service–parameter *" will list all parameters and parameter descriptions for the Get-service assembly. The "Help Get-service–parameter *" function is the same as the previous command, but will be displayed on a per-screen basis. Sometimes we also need to use wildcard characters based on our needs, and the wildcard characters in Windows PowerShell are different from CMD, and you can execute the command "Get-help About_wildcard" to get help for wildcard characters.
Iv. Application of PowerShell
PowerShell can easily view and end processes within the system, so that not only can you monitor suspicious processes within your system, but you can also easily turn them off. To view processes within the current system, you need to open PowerShell, enter Get-process, and then press ENTER, so that the process's handle, the process name, the process's processor time, and the process-unique identifier are displayed. If you want to end one or more processes, you need to record the unique identifier of the process, after entering stop-process in PowerShell, enter the ID of one or more processes as prompted, and the process can be automatically terminated when you press ENTER.

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.