wtorek, 12 listopada 2013

Add and deploy solution with PowerShell

Add-SPSolution -LiteralPath "<path>\MySolution.wsp" | Out-Null
echo " > Adding MySolution..."
start-sleep -s 10
$sln = get-spsolution -identity MySolution.wsp
Install-SPSolution -Identity $sln -GACDeployment
while($sln.Deployed -eq $false) {
echo " > Deploying in progress..."
start-sleep -s 10
}
echo "MySolution is deployed."
Enable-SPFeature -Identity "MyFeatureName" -Url "<my site url>"

Need to know what exactly is your feature name? This command will display all web-scoped features:

Get-SPFeature | Where-Object { $_.Scope -eq "Web" } | Format-Table -Property DisplayName -AutoSize

Brak komentarzy:

Prześlij komentarz