Windows PowerShell in SharePoint 2010 - Tutorial II

Now lets talk about Powershell Commands. Firstly, steps to open up the PoweShell:

On the Start menu, click All Programs.

Click Microsoft SharePoint 2010 Products.

Click SharePoint 2010 Management Shell.

At the Windows PowerShell command prompt (PS C:\>), type the following command, and then press ENTER:

Note : You must be a member of the SharePoint_Shell_Access role on the configuration database and a member of the WSS_ADMIN_WPG local group on the computer where SharePoint 2010 Products is installed. For more info see my post Permissions for Powershell

The Windows PowerShell Get-Command cmdlet gets all commands in the current session.

Command is : Get-Command *

The output for this command looks a lot like the Help output of Cmd.exe. Its basically a tabular summary of all the internal commands along with the CommandTypes.

However, if you want to display Syntax of one command you can use the below command.
For e.g. to get syntax for Get-SPFeature cmdlet use ...

Get-Command Get-SPFeature -Syntax

Note : The Get-Command command does not list every command that is available in Windows PowerShell. Instead, the Get-Command command lists only the cmdlets in the current session.

To get all the Alias (The commands which are assigned nicknames) Use -
Get-Command -CommandType Alias

To get all the functions in the current session Use -
Get-Command -CommandType Function

To display scripts in Windows PowerShell's search path Use -
Get-Command -CommandType Script

For more Commands see : Common PowerShell Commands

Related Post :

What is Windows PowerShell in SharePoint 2010 - Tutorial- I

Windows Powershell Resources

0 comments:

Post a Comment

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at sharepointprogrammingblogger@gmail.com .

Copyright (c) 2010 @ myshaepointwork.blogspot.com. All rights are reserved.Do Not Copy.

@ Learning SharePoint.com