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.
Asked
Active
Viewed 5,539 times
2 Answers
4
A really good explanation is already been given on this blog, so I would suggest you to look at it
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
$featureGuid = "PUT-GUID-HERE"
$web = Get-SPWeb http://localhost
$feature = $web.Features[$featureGuid]
if ($feature -eq $null) { "does not activated" } else { "activated" }
does not activated
OutOfThisPlanet
- 753
- 6
- 26
Change
- 317
- 1
- 2
- 8
1
Powershell script to check whether SharePoint 2010 Feature is activated for a particular Sitecollection
SharePoint 2010 Deployment: Powershell Script Feature
http://ranaictiu-technicalblog.blogspot.co.uk/2010/05/sharepoint-2010-deployment-powershell.html
Ali Jafer
- 17,808
- 1
- 27
- 41
http://sharepoint.stackexchange.com/questions/13051/powershell-script-to-check-feature-status-enabled-disabled-before-activating
– Change Aug 23 '12 at 11:18