PowerShell
Built on the. NET Framework, PowerShell is a task-based command-line shell scripting language that is designed for system administrators and advanced users to quickly automate multiple operating systems (Linux, MacOS, Unix, and Windows) and the management of the application-related processes running on these operating systems.
PowerShell is an open source code
PowerShell Basic source code is currently available on GitHub and is open to community contributions. See PowerShell sources on GitHub.
You can start by getting the desired number of bits in PowerShell. or get a quick look at Getting started
PowerShell Design Goals
PowerShell is designed to improve command-line and scripting environments by eliminating long-standing problems and adding new features.
discoverable
PowerShell simplifies its functionality discovery process. For example, to find a list of cmdlets that you use to view and change Windows services, type:
Get-Command *-Service
After discovering the cmdlet that completed the task, you can run the Get-Help
cmdlet to learn more about this cmdlet. For example, to display Get-Service
the Help information for a cmdlet, type:
Get-Help Get-Service
Most cmdlets emit objects that take action and are then rendered as display text. to fully understand the output of this cmdlet, pass its output through the pipeline to the Get-Member
cmdlet. For example, the following command displays information about the Get-Service
output object members of the cmdlet.
Get-Service | Get-Member
Consistency
Management systems are a complex task, and tools with consistent interfaces help to control the inherent complexities. Unfortunately, the consistency of command-line tools and scriptable COM objects is unknown.
PowerShell consistency is one of its main assets. For example, if you know how to use Sort-Object
cmdlets, you can use this knowledge to sort the output of any cmdlet. you do not need to know the different sort routines for each cmdlet.
In addition, cmdlet developers do not need to design sorting capabilities for their cmdlets. PowerShell contains a framework that provides basic functionality and enforces consistency across multiple aspects of the interface. The framework eliminates some of the choices that are usually left to developers, but it also makes it much easier to develop reliable and easy-to-use cmdlets.
Interactive scripting Environment
PowerShell is a combined, interactive scripting environment that makes it easy for users to access command-line tools and COM objects, and uses the power of the. NET Framework class Library (FCL).
This environment improves the Windows command prompt, which provides an interactive environment with multiple command-line tools. It also improves the Windows script Host (WSH) script, which allows you to use multiple command-line tools and COM automation objects, but does not provide an interactive environment.
By combining all of these features, PowerShell can extend the capabilities of interactive users and script writers, and improve system manageability.
Object Oriented
Although you can type commands in a text box to interact with PowerShell, PowerShell is still based on objects, not text. the output of the command is an object. you can send an output object to another command as its input. As a result, PowerShell provides a familiar interface for users who have used other shell handlers and introduces new powerful command-line examples. It allows you to send objects instead of text, extending the concept of sending data between commands.
easily convert to scripts
With PowerShell, you can easily convert to create and run scripts from interactively typing commands. you can type commands at the PowerShell command prompt to discover the commands that perform a task. You can then save these commands to a copy or history, and then copy them to a file to use as a script.
Detailed content
Https://docs.microsoft.com/zh-cn/powershell/scripting/powershell-scripting?view=powershell-6
PowerShell official documentation