SharePoint PowerShell cmdlets

Lately I have been doing a lot of stuff using PowerShell and avoiding Central Admin UI. It is the next best thing to MS DOS. Oops, sorry… I meant Unix shell. Okay, that sarcasm wasn’t strong enough, I admit…

Anywayz, I decided to list the PowerShell cmdlets I discover or google around so it is easy for me to get to. I will keep adding as I find more. Thanks to those who blogged or suggested neat ways of using PowerShell.

;Adding a Solution
Add-SPSolution -literalpath c:\VisualWebPartProject1.wsp
Install-SPSolution -identity VisualWebPartProject1.wsp -allwebapplications

;Verifying a solution
Get-SPSolution

;Enable a Feature
Enable-SPFeature -identity VisualWebPartProject1_Feature1 -url http://yoursiteurl/

;Verify feature
Get-SPFeature | Sort-Object DisplayName

;Update a solution
Update-SPSolution -literalpath c:\VisualWebPartProject1.wsp -identity VisualWebPartProject1 -GACDeployment

;Get all webs
get-spsite

;Get all sites within a web
get-spsite("http://yoursite").allwebs

;Get all webtemplates within a web
$s = get-spsite("http://yoursite")
foreach($w in $s.allwebs) {$w, $w.webtemplate)

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: