Powerful Windows PowerShell and windowspowershell

Source: Internet
Author: User

Powerful Windows PowerShell and windowspowershell

PowerShell is a very powerful Shell, MacOS has AppleScript, Windows is the entire PowerShell, so let's not talk about it much, write a few simple examples

Enter PowerShell in the command line to come out with a command window, but there is no windows in the XP system, which is available in Wiin7, Win8, and.

1. Computing

Enter 10 + 20 and press enter to see the result 30.

Input kb and MB can be identified.

2. Variables

All variable names are preceded by the $ sign, which is similar to php


$ A = 10

$ B = 20

$ A + $ B

Enter 30

3. Run other commands

Ipconfig, dir, netstat-ano, and other cmd commands can also run and output the results.

4. Run the PowerShell script

Create a txt file and use the record to open it. Then you can write the PowerShell script, which can also be called. net commands, such as SHA256 and Encoding.

After writing the script, change the suffix to. ps1, and then enter the path in the PowerShell command line to execute the script.

By default, the script execution function is disabled. You can run Set-ExecutionPolicy UnRestricted as an administrator and enter yes. Otherwise, an error may occur when executing the script.

There are also a lot of tutorials on how to set parameters for PowerShell.


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

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.