Windows PowerShell Script execution

Source: Internet
Author: User

Execute PowerShell under CMD into shell mode: commands under Windows can be executed such as:
Date  ping   ipconfig  shutdown-Select-string255"  Address"
1, execute script preparation: Get-executionpolicy You can choose to use the execution policy is: Restricted-script cannot run. remotesigned-Scripts created locally can run, but scripts downloaded from the Web cannot run (unless they have a digital signature signed by a trusted publisher). allsigned– can only be run if the script is signed by a trusted publisher. unrestricted– script execution is unrestricted, regardless of where it comes from and whether or not they have a signature. You can use the following cmdlet command to set the execution policy for PowerShell: Set-executionpolicy <policy name> set-executionpolicy remotesigned 2, How to execute script: C:\Scripts\Script.ps1OR.\Script.ps1ORpowershell devicelist.ps1 3, Common script:
 while(1) {Date>>A.logsleep2Ping baidu.com>>A.log} for($i =0; $i-lt -; $i = $i +1) {Write-Host $iecho"ee"}  Do{Write-Host $i $i++} while($i-le5)
4. Execute Python script:
1  while (1>>20171103"$i">>20171103 . log$i++}
-le-gt-eq 
http://www.powershellpro.com/powershell-tutorial-introduction/logic-using-loops/http://www.splaybow.com/ powershell-2.htmlhttp://zh.wikipedia.org/wiki/windows_powershell#. e6.8a.80.e8.a1.93.e5.9f.ba.e7.a4.8e

Windows PowerShell Script execution

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.