Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # install wsp files and deploy to $waUrl web application
- $waUrl = "http://devintranet/"
- $scriptsRootFolder = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
- $wspDir = "$($scriptsRootFolder)\WSPs"
- $wspNames = @(
- "nova.xxx1.wsp"
- "nova.xxx2.wsp"
- "nova.xxx3.wsp"
- "nova.xxx4.wsp"
- )
- foreach($wspName in $wspNames){
- $wspPath = "$($wspDir)\$($wspName)"
- Add-SPSolution -LiteralPath $wspPath -Verbose -Confirm:$false
- $sol = Get-SPSolution -Identity $wspName
- if($sol.ContainsWebApplicationResource){
- Install-SPSolution -Identity $wspName -GACDeployment:$true -Confirm:$false -Verbose -WebApplication $waUrl
- } else {
- Install-SPSolution -Identity $wspName -GACDeployment:$true -Confirm:$false -Verbose
- }
- Write-Host -NoNewline "Deploying $($wspName) "
- Start-Sleep -Seconds 3
- $sol = Get-SPSolution -Identity $wspName
- while($sol.JobExists){
- Write-Host -NoNewline "."
- Start-Sleep -Seconds 3
- $sol = Get-SPSolution -Identity $wspName
- }
- Write-Host " Done"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement