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

When I try to run this cmdlet, I receive the following errors (only sometimes):

Disabling feature: SPFeatureDefinition Name=FeatureDefinition/b89234a6-xxxx-xxxx-xxxx-200dd03e1fdd ( XXXStructures_XXXContentTypes , b89234a6-xxxx-xxxx-xxxx-200dd03e1fdd ) VERBOSE: Leaving BeginProcessing Method of Disable-SPFeature. VERBOSE: Performing operation "Disable-SPFeature" on Target "Site Scope |b89234a6-xxxx-xxxx-xxxx-200dd03e1fdd". Disable-SPFeature : Cannot complete this action. Please try again.

The part of the script that is producing this is...

foreach ($feature in $features) {
    if ($feature -ne $null) {
        Write-Host "`nDisabling feature:  " $feature "(" $feature.DisplayName "," $feature.ID ")"
        Disable-SPFeature $feature -url <my URL> -Confirm:$false -Force -verbose
        Start-Sleep -Seconds 10
    }   
share|improve this question
    
Check the ULS logs for more detailed error information. –  Jasper Sep 13 '12 at 6:48
    
Actually using -force should swallow all exceptions (which is why you should NEVER use it unless you do get errors trying to disable it). As Jasper say, post relevant ULS log entries so we can see stack trace of error –  Anders Rask Sep 24 '12 at 13:03

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.