Activate-Deactivate Features Programmatically in SharePoint

At times, We may have to activate/deactivate features programmatically. Here is the code snippet: PowerShell way to Activate-Deactivate Features: To activate a feature in PowerShell: Enable-SPFeature -identity <Feature-Folder-Name/GUID> -URL <URL-of-Web-app/Site coll/Site> To deactivate a feature: Disable-SPFeature -identity <Feature-Folder-Name/GUID> -URL <URL-of-Web-app/Site coll/Site>

Read more