About Help

Choose a topic from the list on the left or search for a specific topic. Choose a topic from the list or search for a specific topic.
Cmdlets  Providers  Aliases  Modules
 

about_SPFeature

Spfeature

SharePointDSC
 

SHORT DESCRIPTION

 

.NAME

    SPFeature 
 
# Description 
     
    This resource is used to make sure that a specific feature is either enabled 
    or disabled at a given URL/scope. The Ensure property will dictate if the 
    feature should be on or off. The name property is the name of the feature 
    based on its folder name in the FEATURES folder in the SharePoint hive 
     
.PARAMETER Name 
    Key - string 
    The name of the feature 
 
.PARAMETER FeatureScope 
    Required - string 
    Allowed values: Farm, WebApplication, Site, Web 
    The scope to change the feature at - Farm, WebApplication, SiteCollection or Site 
 
.PARAMETER Url 
    Key - string 
    The URL to change the feature at 
 
.PARAMETER Ensure 
    Write - string 
    Allowed values: Present, Absent 
    Present if the feature is to be enabled, Absent if it is to be disabled 
 
.PARAMETER Version 
    Write - string 
    The version of the feature to check against 
 
.PARAMETER InstallAccount 
    Write - String 
    POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 
 
 

.EXAMPLE

    This example shows how to enable a site collection scoped feature  
 
 
    Configuration Example  
    { 
        param( 
            [Parameter(Mandatory = $true)] 
            [PSCredential] 
            $SetupAccount 
        ) 
        Import-DscResource -ModuleName SharePointDsc 
 
        node localhost { 
            SPFeature EnableViewFormsLockDown 
            { 
                Name                 = "ViewFormPagesLockDown" 
                Url                  = "http://www.contoso.com" 
                FeatureScope         = "Site" 
                PsDscRunAsCredential = $SetupAccount 
                Version              = "1.0.0.0"      
            } 
        } 
    } 
 
 

.EXAMPLE

    This example shows how to disable a site collection scoped feature  
 
 
    Configuration Example  
    { 
        param( 
            [Parameter(Mandatory = $true)] 
            [PSCredential] 
            $SetupAccount 
        ) 
        Import-DscResource -ModuleName SharePointDsc 
 
        node localhost { 
            SPFeature EnableViewFormsLockDown 
            { 
                Name                 = "ViewFormPagesLockDown" 
                Url                  = "http://www.contoso.com" 
                FeatureScope         = "Site" 
                Ensure               = "Absent" 
                PsDscRunAsCredential = $SetupAccount 
                Version              = "1.0.0.0"      
            } 
        } 
    }