Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am looking for a good example of powershell script for SP2010 with which I could activate my features with prior check if feature has been deployed (some are "web" and some are "site" scoped. Could you please guide me or provide some samples.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

A really good explanation is already been given on this blog, so I would suggest you to look at it

features-with-powershell/

Possibly Duplicate Question

EDIT

detect if a feature is deployed or not

detecting-solution-deploying-status

Edit 2

Code of checking if a feature is activated or not

PS C:\Users\omlin> $featureGuid = "PUT-GUID-HERE"
PS C:\Users\omlin> $web = Get-SPWeb http://localhost
PS C:\Users\omlin> $feature = $web.Features[$featureGuid]
PS C:\Users\omlin> if ($feature -eq $null) { "does not activated" } else { "activated" }
does not activated
PS C:\Users\omlin>
share|improve this answer
    
I had checked that but not of much help to me. Thanks anyways –  V.B Aug 23 '12 at 10:50
    
I updated my answer and how is it not helpful, can you be specific ? –  Ignacio Aug 23 '12 at 10:52
    
I want to check if feature is deployed before activation. –  V.B Aug 23 '12 at 11:00
    
I updated my answer again, check out the link that shows yu how to check feature deployment status :) –  Ignacio Aug 23 '12 at 11:05
1  
your question says to how to check if a feature is deployed or not, can you ask another question and I will try to give you an example :) –  Ignacio Aug 23 '12 at 11:12

Powershell script to check whether SharePoint 2010 Feature is activated for a particular Sitecollection

http://social.technet.microsoft.com/Forums/en-GB/sharepoint2010setup/thread/fa74e065-9fa6-4c8c-8ea7-18899b11d066

SharePoint 2010 Deployment: Powershell Script Feature

http://ranaictiu-technicalblog.blogspot.co.uk/2010/05/sharepoint-2010-deployment-powershell.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.