Activate feature with Event receiver by Powershell
#There is a problem with Enable-SPFeature command in case of having event receiver in the feature. Feature Activated event is not fired. This is used as workaroud..
#Activate Site Feature with Event Receiver
param($siteUrl, $featureName)
Heading $script:MyInvocation.MyCommand.Name
$feature = Get-SPFeature $featureName
if($feature)
{
$featureId = $feature.Id;
$site = Get-SPSite $siteUrl
if(-not $site.Features[$featureId])
{
$site.Features.Add($featureId);
}
}
$site.Dispose()