what is the right order of feature installation and solution install in a powershell sharepoint deployment script

I am writing a sharepoint project deployment script using powershell.

It is a project contains three webparts, and two feature, one is at the farm scope and the other is at the site scope.

My current script has steps in the following order:

1. Disable -SPFeature for the site scope one

2. Uninstall -SPFeature for the site scope one

3. Disable-SPFeature for the farm scope one

4. Uninstall-SPFeature for the farm scope one

5. Uninstall-SPSolution

6. Remove-SPSolution

7. Install-SPFeature of the farm scope one

8 Install -SPFeature of the site scope one

9. Enable-SPFeature for the site scope one.

 

Currently,  the script need to be run twice before the new changes is showing up in the sharepoint site.

If I deploy from Visual studio, I only have to deploy once and new changes are showing up. 

I want to find out why. I looked at the log in 14 hive, it showed that Visual studio was doing some order of "deactive feature, uninstall, reinstall, then deploy solution...." 

What is the proper order of the deployment?

 

Thanks.

January 20th, 2011 10:59pm

Hi,

Are you running disable, enabble commands in the same PowerShell instance?(same window) if that is the case PowerShell will cache the old feature and just enable that old feature again. Try having separate scripts for enable and disable features and running them in different windows or put the enable and disable features inside a powershell.exe "your code here" that will open a new window for your enable feature to run inside. here's an example.

PowerShell.exe "Add-PSSnapin Microsoft.SharePoint.PowerShell; Get-SPFeature -Identity"$Feature.id"-Site "$Site.Url" | ForEach-Object {`$_.Update()}"

This line of code will update the feature but you get the picture.

Free Windows Admin Tool Kit Click here and download it now
July 6th, 2013 3:42am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics