We can deploy the wsp solutions using the
powershell command, but each time we deploy them, we need to remember
the command and give KT to the people who are deploying them for the
first time.
Keeping all those in mind, I have created powershell script and a batch file. User just need to copy them to the server where they want to update the existing wsp and click the .bat file. That's it!
Steps to Update Solution
Keeping all those in mind, I have created powershell script and a batch file. User just need to copy them to the server where they want to update the existing wsp and click the .bat file. That's it!
Steps to Update Solution
- Open the notepad and copy the below script and save the file as UpdateSolution.ps1
1: Add-PsSnapin Microsoft.SharePoint.PowerShell
2: $wspFileName= read-host "Enter the wsp package name to update"
3: $Path = read-host "Enter the wsp file Location Ex:D:/Solutions/"
4: $filePath = "$Path$wspFileName"
5: if($wspFileName -ne "")
6: {
7: try
8: {
9: write-host "Upgrading the wsp...."
10: Update-SPSolution -Identity $wspFileName -LiteralPath $filePath -GACDeployment -force
11: write-host "solution upgraded successfully"
12: }
13: catch
14: {
15: write-error "Error occured while upgrading"
16: }
17: }
18: Remove-PsSnapin Microsoft.SharePoint.PowerShell
- Create a batch file with name "UpdateSolution.bat" and copy the below content to it.
1: cd /d %~dp0
2: powershell -noexit -file ".\UpdateSolution.ps1" "%CD%"
3: pause
- Copy the above 2 files created above to the server where you want to update and click the UpdateSolution.bat file from where the execution starts.
No comments:
Post a Comment