1. Poweshell-what ' s Windows PowerShell

Source: Internet
Author: User
Tags aliases powergui

1. What is Windows PowerShell

    • Windows PowerShell is a new Windows command-line shell designed especially for system administrators. The Windows PowerShell includes an interactive prompt and a scripting environment The can is used independently or in COM Bination.


    • Unlike most shells, which accept and return text, Windows PowerShell was built on top of the. NET Framework Common Language Runtime (CLR) and the. NET Framework, and accepts and returns. NET Framework Objects


    • Chinese explanation

PowerShell is a new shell program provided by Microsoft that uses a new command prompt and scripting environment. What does using PowerShell bring to your system administrator? What are the benefits of learning PowerShell? If you already have the experience of managing and using VBScript, believe you already know the answer. Active directory domains have now become much larger and more complex, and for those who are tied to the GUI and Microsoft Management Console, PowerShell will make them free!

I do not know if you have logged into each server, the client to modify the registry experience, or batch processing files, batch configuration ... What do you do when you encounter these problems? Manual configuration? or run a script to fix the problem? People who often use VBScript will of course choose the latter, but they will ask, why do I have to learn PowerShell?

The answer is simple: PowerShell uses an object-oriented approach, based on. Net, which is not available or supported by VBScript.


PowerShell is object-based rather than text-based

If you are familiar with Cmd.exe and batch scripts, then I think you need some time to make conceptual changes. PowerShell is fundamentally different from the concept of using VBScript and other programming languages, and the output from the traditional command prompt is text-based and not in PowerShell. It looks like text, but it's actually an object. That's why I said PowerShell is powerful because the output of one PowerShell command (object) can be entered into another command without adding additional code. In a traditional scripting language, if you want a command to pass to another command, you need extra code to translate the commands you need to pass into the data and format that the second command can understand. In addition to a problem, what is the object? This sounds familiar, "Everything inside an Active Directory domain is an object." "For example, our servers, computers, printers, security groups, group policies, users, etc., with PowerShell, we can easily interact with these objects: viewing information, and creating, modifying, or deleting it.


Customizing the PowerShell commands

The PowerShell command is called a cmdlet. PowerShell comes with more than 100 cmdlets. The PowerShell development team used their infinite imagination to create aliases for these cmdlets, allowing us to make the most of the traditional commands we used to do, such as Dir, CD, Del, copy, and so on. Even a UNIX veteran can easily use commands such as LS and man. To best cater to user habits and simplify operations, PowerShell allows users to create their own defined aliases for cmdlets, and even create their own cmdlets.


PowerShell is a command-line interpreter and scripting environment

In a nutshell, PowerShell has both worlds. DOS is just a command-line interpreter, input a command, then get output, of course, you can also use a batch file, but the batch file is essentially just a simplification of the operation of the input command. In VBScript, WSH (Windows Scripting Host) can be leveraged, but it is not possible to enter VBScript code at the command prompt. PowerShell is different and similar, but it can not only enter commands, but also build scripts at the command line. A powerful feature of PowerShell is the ability to build and test code at the command prompt.


2. PowerShell Version


    • Version 1.0

Version 1.0 is released in 2006 forWindows XPSP2/SP3,Windows Server 2003, andWindows Vista. forWindows Server , it's included as an optional feature.

    • Version 2.0

Version 2.0 is integrated withWindows 7 andWindows Server R2And is released forWindows XPwith Service Pack 3,Windows Server 2003With Service Pack 2 andWindows VistaWith Service Pack 1.

    • version 3.0

A New Community Technology Preview 2 (CTP 2) version of the Windows Management Framework 3.0 is released by Microsoft in Dece Mber, 2011


3. Scripts Tools:

  • windows PowerShell ISE:

    Action steps:

    Windows PowerShell integrated Scripting Environment (ISE) is a host application for Windows PowerShell. Start Windows PowerShell ise  in the Windows PowerShell console Cmd.exe or the Run box, type Powershell_ise.exe.

  • PowerShell Script Editor: (powergui.2.3.0.1503)

    Download from Here:http://powergui.org/index.jspa

    PowerGUI, a graphical user interface and script Editor for Microsoft Windows powershell!




4. Reference documents:

Https://msdn.microsoft.com/en-us/library/ee809360.aspx

http://marui.blog.51cto.com/1034148/289823

This article from "Ricky's Blog" blog, reproduced please contact the author!

1. Poweshell-what ' s Windows PowerShell

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.