Getting started with PowerShell

Source: Internet
Author: User
Tags powergui
Build Environment:

Windows 2.0 and Win2008 come with PowerShell. Enter powershell in the command.

Http://www.microsoft.com/download/en/details.aspx? Displaylang = en & id = 20430

Use Windows PowerShell ISEWrite code. The user experience is similar to writing c # code. Enter powershell_ise in the running command.

Third-party development tool: PowerGUI.3.1.0.2058.msi, which provides smart sensing.

Common shortcut keys:

After saving the ps file, you can press F9 to start debugging.

F10 jump debugging

F11 single-step debugging

Get-command * uninstall commands that contain partially matched keywords

Get-help uninstall-spsolution-example

Ctrl + c wrap

Programming Skills

Use the methods in the PowerShell keystore library file:

Note: GetNoByName is a method in GetName. ps1.

Add-PSSnapin Microsoft. SharePoint. PowerShell-EA SilentlyContinue
. ("D: \ Mingle \ PS \ GetName. ps1 ")
GetNoByName "fdsfdsafd"

Execute PS files using Bat files

Note: % ~ Dp0 indicates the current path

PowerShell-command Set-ExecutionPolicy "Bypass"
PowerShell-command "& {% ~ Dp0mainbody. ps1-path % ~ Dp0-configurationFilePath % ~ Dp0 \ DeployemntConfiguration. xml-sectionid AZ_EIP-modulename 'common '}"
Pause

Use write-host' for auxiliary debugging

Write-host "Add Groups operation canceled"

Use Exception in PowerShell

Http://huddledmasses.org/trap-exception-in-powershell/

Use Powershell to integrate the SharePoint command window

 

Author: MingleLui
Source: http://mingle.cnblogs.com/

 

Windows 2.0 and Win2008 come with PowerShell. Enter powershell in the command.

Http://www.microsoft.com/download/en/details.aspx? Displaylang = en & id = 20430

Use Windows PowerShell ISEWrite code. The user experience is similar to writing c # code. Enter powershell_ise in the running command.

Third-party development tool: PowerGUI.3.1.0.2058.msi, which provides smart sensing.

Common shortcut keys:

After saving the ps file, you can press F9 to start debugging.

F10 jump debugging

F11 single-step debugging

Get-command * uninstall commands that contain partially matched keywords

Get-help uninstall-spsolution-example

Ctrl + c wrap

Programming Skills

Use the methods in the PowerShell keystore library file:

Note: GetNoByName is a method in GetName. ps1.

Add-PSSnapin Microsoft. SharePoint. PowerShell-EA SilentlyContinue
. ("D: \ Mingle \ PS \ GetName. ps1 ")
GetNoByName "fdsfdsafd"

Execute PS files using Bat files

Note: % ~ Dp0 indicates the current path

PowerShell-command Set-ExecutionPolicy "Bypass"
PowerShell-command "& {% ~ Dp0mainbody. ps1-path % ~ Dp0-configurationFilePath % ~ Dp0 \ DeployemntConfiguration. xml-sectionid AZ_EIP-modulename 'common '}"
Pause

Use write-host' for auxiliary debugging

Write-host "Add Groups operation canceled"

Use Exception in PowerShell

Http://huddledmasses.org/trap-exception-in-powershell/

Use Powershell to integrate the SharePoint command window

 

Author: MingleLui
Source: http://mingle.cnblogs.com/

 

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.