I have done a resuable workflow in my test environment. I want to move it to every site collection in the farm.
I want do it with powershell, because we have many site collection.
I'm using Add-SPUserSolution
and Install-SPUserSolution
as shown below.
$wspName="abc.wsp"
$wspPath="C:\wsp\"+$wspname
$WebAppsUrlColl = "http://myspsite"
foreach($WebAppUrl in $WebAppsUrlColl)
{
Write-host "Scanning Web Application:"$WebApp.Name
$WebApp=Get-SPWebApplication $WebAppUrl
$SitesColl = $WebApp.Sites
foreach ($Site in $SitesColl)
{
Write-host "Scanning Site Collection:"$Site.
Add-SPUserSolution -LiteralPath $wspPath -Site $Site -ErrorAction SilentlyContinue
Install-SPUserSolution -Identity $wspName -Site $Site -ErrorAction SilentlyContinue
}
}
After I run the code, it works. But feature is not activated:
When I go to Site Settings > Web Designer Galleries > Solutions, I can see my wsp file.
Also when I go to Site Settings > Site Actions > Manage site features , I can see my WorkFlow Template. But the workflow template is deactivated.
When I run Get-SPFeature -Site http://myspsite
I can not WorkFlow Template
How I can activate Workflow Template Feature with powershell?