Need job

Looking for job in Europe. Please contact thru LinkedIn profile.

Thursday, February 21, 2013

Remote upgrade Sharepoint solution with PowerShell

Hello everybody!
Here is a script to upgrade Sharepoint solution on remote server.
U need to allow the remote powershell on the server.
U can replace the sriptblock with any commands. For example Add-Solution)

net use W: /delete
net use W: \\serverName\C$\folder
copy "C:\Users\user\Documents\Visual Studio 2012\Projects\Project\bin\Debug\Project.wsp" W:\
$s = New-PSSession -computerName serverName
Invoke-Command -Session $s -Scriptblock {Add-PSSnapin Microsoft.SharePoint.Powershell;Update-SPSolution -Identity Project.wsp -LiteralPath c:\folder\Project.wsp -GACDeployment}
Remove-PSSession $s

No comments:

Post a Comment