Windows PowerShellIs a new ......
Well, I believe you have read this sentence N times before reading this article ......
PowerShell is a new shell program provided by Microsoft. It uses a new command prompt and script environment. What does PowerShell bring to the system administrator? What are the benefits of learning PowerShell? If you already have experience managing and using VBScript, I believe you already know the answer. Active Directory domains have now become larger and more complex. For administrators who are bound to the GUI and Microsoft console, PowerShell gives them freedom!
I wonder if you have logged on to each server or client to modify the registry, or you have to process files in batches and configure them in batches ...... What do you do when you encounter these problems? Manual configuration? Or run a script to solve the problem? People who often use VBScript will certainly select the latter, but they will ask, why do I need to learn PowerShell?
The answer is simple: PowerShell uses an Object-oriented Method Based on. Net, which is not provided or supported by VBScript.
PowerShell is based on objects rather than text
If you have been familiar with using cmd.exe and batch processing scripts, I think it takes some time for you to make a conceptual change. PowerShell is fundamentally different from the concepts that use VBScript and other programming languages. The output of a traditional command prompt is text-based, but not in PowerShell. It looks like text, but it is actually an object. This is why I say PowerShell is powerful, because the output of a PowerShell command (object) can be input to another command without additional code. In traditional scripting languages, if you want to pass one command to another, you need additional code to convert the commands to be passed into the data and format that can be understood by the second command. Another question is involved: What is the object? This sounds familiar. "Everything in Active Directory is an object ." For example, with PowerShell, our servers, computers, printers, security groups, group policies, and users, we can easily interact with these objects: View information, and create, modify, or delete.
Customize PowerShell commands
PowerShell commands are called cmdlets. PowerShell comes with more than 100 cmdlet. The PowerShell development team uses their infinite imagination to create aliases for these cmdlet, so that we can use the traditional commands we are used to operate as much as possible, such: dir, cd, del, copy, and so on. Even a veteran of UNIX can easily use commands such as ls and man. To maximize user habits and simplify operations, PowerShell allows users to create their own alias for the cmdlet, or even create their own cmdlet.
PowerShell is a command line interpreter and script environment.
In summary, PowerShell has the best of both worlds. DOS is just a command line interpreter. You can enter the command and get the output. Of course, you can also use the batch processing file, however, the batch file is essentially a simplification of the input command. In VBScript, WSH (Windows Script Host) can be used, but VBScript Code cannot be entered at the command prompt. PowerShell is different from them but similar. It can not only input commands, but also build scripts on the command line.This will be detailed in future tutorials.
In the next few weeks, I will continuously Post basic PowerShell tutorials to provide you with a solid foundation and a good start.
I will focus on the following aspects:
• Configuration and customization of Windows PowerShell Console
• PowerShell basics: cmdlet, parameter, command type ......
• Use PowerShell Command Format output
• Use a Windows File System
• WMI and. NET
• Use variables in PowerShell
• Application
At the beginning, we will focus on the basic commands and shell features of PowerShell and learn about its basic usage. You also need to know that a powerful function of PowerShell is to create and test code at a command prompt. In our past experience, we often write a script first, then test it, and then adjust the previously written script, as in VBScript. However, the power of PowerShell is that you can write a script after the command line, which will be described in detail later.
PowerShell http://support.microsoft.com/kb/968929
Official instance tutorial http://technet.microsoft.com/zh-cn/scriptcenter/dd742419.aspx