Tuesday, 3 December 2013

Add, Install, Enable, Update, Disable, Uninstall, and Remove with PowerShell: .wsp file

Add, Install, Enable, Update, Disable, Uninstall, and Remove with PowerShell:
1) Update lines 1-4.
2) Remove the pound(#) symbol of the command you want to run.

01$fileLocation = "C:\Projects\Event Receiver\bin\Debug"
02$wspFileName = "Event_Receiver.wsp"
03$featureIdentity = "Event Receiver_Feature1"
04$url = "http://pc2010.local/"
05$literalPath = $fileLocation + "\" + $wspFileName
06 
07write-host $literalPath
08 
10# add-spsolution -literalpath $literalPath
11 
13# update-spsolution -identity $wspFileName -literalpath $literalPath -gacdeployment
14 
16# install-spsolution -identity $wspFileName -allwebapplications -gacdeployment -force
17 
19# Enable-spFeature -identity $featureIdentity -url $url
20 
22# disable-spfeature -identity $featureIdentity -url $url -force -confirm:$false
23  
25# Uninstall-SPSolution -identity $wspFileName -confirm:$false
26 
28# Remove-SPSolution -identity $wspFileName -force -confirm:$false

No comments:

Post a Comment