PowerShell Development tools

Source: Internet
Author: User

PowerShell was briefly described in the previous section, with a detailed reference to the PowerShell introduction, which describes the development tools for PowerShell and its settings considerations.


This article contains the following knowledge points

    1. How to start the Windows PowerShell command-line development tool

    2. Simple settings for Windows PowerShell command line

    3. How to start Windows Powershell ISE integrated development tool

    4. View the version of PowerShell

    5. Summarize

PowerShell is a tool that comes with Windows systems and is part of a Windows system patch, so when you're developing PowerShell, you don't need to install any additional software if you use Windows 7 and above. If it is XP system, need to install patch KB968930, download windows XP PowerShell patch hard poke here.

Note that Windows PowerShell requires the. NET Framework V4, it is recommended to install the latest. NET Framework, and in order to maximize the use of the PowerShell command set, it is best to install the. NET Framework v3.5 SP 1 and. NET Framework v4.0.

How to start the Windows PowerShell command-line development tool

The PowerShell command-line development tools can be started from the Start menu, click Start, clicking All Programs, Accessories, Windows PowerShell folders, and Windows PowerShell items.

You can also click the window key on your keyboard to enter PowerShell in the search box. Different Windows systems will display different options at this time.

    • If you are a 64-bit Windows system, the following 4 options are available

      Windows PowerShell

      Windows PowerShell (x86)

      Windows PowerShell ISE

      Windows PowerShell ISE (x86)


      It is clear that for 64-bit Windows systems, two versions of PowerShell are supported. There is no difference between the two versions of PowerShell for PowerShell, and Microsoft provides support for the x86 (32-bit) system, primarily for backwards compatibility. The other two non-x86 versions are 64-bit versions.

    • If you are a 32-bit Windows system, the following 2 options are available

      Windows PowerShell

      Windows PowerShell ISE

      It is important to note that there are only 32-bit versions in 32-bit systems, even if they are not labeled "x86" at the back.

To start the PowerShell command-line tool, just click Windows PowerShell or Windows PowerShell (x86), and if it is a 64 system, it is highly recommended to use the 64 version. Command-line tools are similar.

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8B/B0/wKioL1hVU3Tzb0iaAABU23VM9Ts989.jpg-wh_500x0-wm_3 -wmp_4-s_2692541461.jpg "title=" Pscmd. JPG "alt=" Wkiol1hvu3tzb0iaaabu23vm9ts989.jpg-wh_50 "/>

The "PS" at the beginning of the command line represents the current mode of the real PowerShell.


The PowerShell command form has the following disadvantages (compared to the PowerShell ISE Integrated development Environment)

    • Double-byte character set is not supported.

      This means that non-English characters may not be displayed correctly and can be entered or copied under Chinese test.

    • The Clipboard is a non-standard keystroke operation.

      This is the same as the cmd command form, the support for CTRL + C and CTRL + V is a mess, you have to choose by the mouse, right click, choose Paste or copy. The following describes the integrated development environment for PowerShell Ise, which is called a perfect for CTRL + C and CTRL + V as well as keyboard operation support.

    • Support for automatic (tab) Completion of commands is not good.

      This is mainly manifested in PowerShell 1.0, 2.0, 3.0, and 4.0, and the automatic completion of command forms is as perfect in PowerShell version 5.0 as it is in Ise.

Note that this series of PowerShell articles is primarily for versions 2.0 and above , meaning that if you are using a PowerShell that is 2.0 and above, the commands in this series can be executed correctly, but the output of the results will be somewhat different.

Simple settings for Windows PowerShell command line

PowerShell the command line form is similar to the cmd command form, which allows you to make simple settings for font size, color, form size, and background color. Set the same way as the cmd command form, right-click the form title bar (top Border), select Properties, open the Windows PowerShell property settings form to set it to its preferred style, and set the most basic criteria for distinguishing between characters and punctuation that are not easily distinguishable. such as lowercase l and number 1, Small Letter O and number 0, single quotation mark and interval number (the key under "ESC" in the English input state)

Please note the following two points when setting up the PowerShell command line form .

    • Adjusts the size of the buffer.

      as shown. In the following we will introduce, PowerShell can view the history of input command record, the larger buffer can see the number of History bar also more, it should be noted that the PowerShell history command record is only for the current session, that is, if the current form is closed, and then open, Unable to view previously entered command record.

    • Adjust the width of the screen buffer size and the width of the window size

      As shown in two, on the "Layout" tab. It is strongly recommended that you set both sizes to the same value . This setting avoids the scrollbar at the bottom, which is described later in the format that PowerShell can set the output as a command, and if the size of the two is inconsistent, the output may be "squeezed" to the right side of the buffer, even if the scroll bar at the bottom is scrolled, Also can not see the output of the command or the result is not completed, affecting the command results of viewing and debugging.

      650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/B0/wKioL1hVWwihCT0vAABx5kE9F7c814.jpg-wh_500x0-wm_3 -wmp_4-s_4149187843.jpg "title=" proleft.jpg "alt=" wkiol1hvwwihct0vaabx5ke9f7c814.jpg-wh_50 "/>650" this.width= 650; "Src=" Http://s5.51cto.com/wyfs02/M01/8B/B3/wKiom1hVWySAQhjwAABtvBQ1LEc769.jpg-wh_500x0-wm_3-wmp_4-s_ 1300699542.jpg "title=" proright.jpg "alt=" Wkiom1hvwysaqhjwaabtvbq1lec769.jpg-wh_50 "/>


How to start Windows Powershell ISE integrated development tool

ISE (Integrated Scripting Environment) starts in the same way as the command form, you can start from the Start menu, click Start, clicking All Programs, Accessories, Windows PowerShell folders, and "Windows PowerShell ise" entry, or if you have already opened a command form, you can enter "Ise" to start the PowerShell ISE development environment, such as.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8B/B4/wKiom1hVYK6TDWA7AACOBgRlRfI505.jpg-wh_500x0-wm_3 -wmp_4-s_2914187740.jpg "Title=" ise. JPG "alt=" Wkiom1hvyk6tdwa7aacobgrlrfi505.jpg-wh_50 "/>

Ise has the following advantages over the PowerShell command form .

    • supports PowerShell syntax highlighting .

      Like other high-level languages, syntax highlighting can help distinguish which commands are available from the system, which are defined by themselves, and syntax highlighting is useful for checking and troubleshooting scripts.

    • Support for Script debug (Single Step).

      This should be one of the features of PowerShell that is very prominent compared to other scripting languages, which can debug means that debug scripts are no longer completely dependent on the Print log debug, can be like Java, C # and other high-level languages, through the ISE, can be single-step debugging scripts, very conducive to script inspection and error exclusion.

    • supports copy-and-paste operations for commands .

      In addition to CTRL + C and CTRL + V support, but also support other keyboard operations, such as through the "Shift" key and the left and right arrow keys, home,end keys for command selection.

    • Supports double-byte character sets.

      Non-English characters can also be displayed normally.

Each of these points can be described with "great, Word PowerShell". Of course, the real attraction is its object-oriented capabilities, which will be introduced gradually in subsequent articles.

View the version of PowerShell

In addition to Ise, viewing the PowerShell version is the second command introduced in this section, in command-line forms or command-line input $PSVersionTablein Ise, in the results of the output, If the Psversion field corresponds to a version of 2.0 or more, there is no problem with your environment learning this series of courses.

Summarize

Through this section of learning, you should grasp the following content.

    • You can start the Windows PowerShell command form and the ISE integrated development environment.

    • The PowerShell command form can be easily set up for development, with support for single-and dual-character sets in command forms and ISE, and Ise supports the syntax highlighting and debugging capabilities of PowerShell scripts.

    • The version of the current PowerShell is viewed.



This article from "Flower Blossom Fall" blog, declined reprint!

PowerShell Development tools

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.