What Does PowerShell Mean?
PowerShell is an automated task framework from Microsoft, with a command line shell and a scripting language integrated into the .NET framework, which can be embedded within other applications. It automates batch processing and creates system management tools. It includes more than 130 standard command line tools for functions and enables administrators to perform tasks on local and remote Windows systems through access to Component Object Model (COM) and Windows Management Instrumentation (WMI).
Techopedia Explains PowerShell
Windows PowerShell executes four types of commands:
- Cmdlets
- PowerShell functions
- PowerShell scripts
- Executable programs
PowerShell automates tasks using cmdlets. These are .NET application programming interface (API) classes appearing as system commands and implementing specific functions. They are the native commands in PowerShell and process objects individually. They are used as recipients in a pipeline and receive and output results as objects. Cmdlets on each object in a collection are invoked in a sequence by PowerShell. They are derived from the Cmdlet or PsCmdlet base classes. When a cmdlet runs, the methods ProcessRecord(), BeginProcessing() and EndProcessing() are invoked. The class implementing cmdlet holds one .NET attribute and the Cmdlet attribute, which specifies the name of the cmdlet. Cmdlets use .NET data access APIs directly or may use the power shell infrastructure to make the data store available using specific paths.
PowerShell has an interactive command line interface. PowerShell allows the user to produce aliases for cmdlets, which are converted to the original commands by PowerShell.
Pipeline is an important concept included in PowerShell. The output of a command is passed over to another command using a | operator. Unlike Unix pipelining, the commands passed are typed objects with a consistent interface, which retain their structure during the process and do not require additional parsing. These objects encapsulate functions working on contained data. The output object of the last cmdlet is pipelined to an Out-Default cmdlet, which converts the object into a stream of format objects and renders them on the screen.
Microsoft has released PowerShell 2, which is installed by default on Windows 7 and Windows Server 2008 R2. PowerShell V2 includes about 240 cmdlets and includes changes in scripting language and the hosting API. New features added in PowerShell V2 are:
- Data Language: This is a subset of the PowerShell scripting language. It permits data definitions to be separated from the scripts and allow string resources to be imported into the script at runtime.
- PowerShell Remoting: This invokes cmdlets and scripts on remote machines using workstation management.
- Script Debugging: This permits breakpoints on scripts and functions for easy location of commands.
- Background Jobs: This invokes command sequences asynchronously.
- Network file transfer: Asynchronous transfer of files between machines.
- Modules: These organize and partition scripts in reusable units.
- Transaction: This involves transaction cmdlets for starting, committing and rolling back transactions.
- Scriptcmdlets: These are cmdlets designed using the PowerShell Scripting Language.
- Eventing: This listens, forwards and acts on system events.
- Integrated Scripting Environment: This enables only selected parts of the script to run and provides a GUI-based PowerShell with syntax highlighting, integrated debugger and tab completion.