• Understand and manage SharePoint solutions through powershell


    Stsadm.exe days are gone. Just for legacy purpose this commands are still compatible with SharePoint 2010, but let's see in this article how things have evolved after SharePoint 2007.
    The first consideration that must be done before starting to use SharePoint's Powershell is that each command has it's own manual. So if you get stuck with a command, just type: man yourTrickyCommand. If you have just a little of Unix/Linux shell's commands background you should be already comfortable with this approach.

    Let's start from the beginning by adding a solution into your farm

    • SharePoint 2007: stsadm -o addsolution -filename "pathToSolutionFile.wsp"
    • SharePoint 2010: Add-SPSolution "pathToSolutionFile.wsp"

    and if you want to check the Add-SPSolution manual, just type  man Add-SPSolution, and you will receive the following output:

    NAME 
        Add-SPSolution 
     
    SYNOPSIS 
        Uploads a SharePoint solution package to the farm. 
     
     
    SYNTAX 
        Add-SPSolution [-LiteralPath]  [-AssignmentCollection ] [-Confirm []] [-Language ] [-WhatIf [ 
        ]] [] 
     
    DESCRIPTION 
        The Add-SPSolution cmdlet adds a SharePoint solution package to the farm. T 
        his cmdlet does not deploy the uploaded SharePoint solution. Use the Instal 
        l-SPSolution cmdlet to deploy the SharePoint solution in the farm. 
     
        For permissions and the most current information about Windows PowerShell f 
        or SharePoint Products, see the online documentation (http://go.microsoft.c 
        om/fwlink/?LinkId=163185). 
     
    RELATED LINKS 
        Get-SPSolution 
        Update-SPSolution 
        Uninstall-SPSolution 
        Remove-SPSolution 
        Install-SPSolution 
        Remove-SPSolutionDeploymentLock 
     
    REMARKS 
        To see the examples, type: "get-help Add-SPSolution -examples". 
        For more information, type: "get-help Add-SPSolution -detailed". 
        For technical information, type: "get-help Add-SPSolution -full".

    NAME


    Finally we have the full documentation into our shell!
    There are two things that are really interesting:

    • RELATED LINKS
    • REMARKS

    With the related links, we got all the informations needed to Install, Update, Delete, and with the remarks section we can see by examples how to definitely master the command. 
    So if we need few examples, just type: get-help Add-SPSolution -examples

    NAME 
        Add-SPSolution 
     
    SYNOPSIS 
        Uploads a SharePoint solution package to the farm. 
     
        ------------------EXAMPLE------------------ 
     
        C:\PS>Add-SPSolution -LiteralPath c:\contoso_solution.wsp 
     
        This example adds the SharePoint solution in the file contoso_solution.wsp 
        to the farm.

    Once you know how to obtain the PowerShell's commands documentation you are able to deepen by yourself.
    I will just list you common PowerShell commands that are used mostly when deploying and installing SharePoint Solutions for a quick reference.

    Solutions

    Deploy a solution

    • SharePoint 2007: sstsadm -o deploysolution -name SolutionFile.wsp -url http://yourServerUrl/ -immediate
    • SharePoint 2010: Install-SPSolution -Identity SolutionFile.wsp -WebApplication http://yourServerUrl/

    Upgrade a solution

    • SharePoint 2007: stsadm -o upgradesolution -name SolutionFile.wsp -filename pathToSolutionFile.wsp
    • SharePoint 2010: Update-SPSolution -Identity SolutionFile.wsp -LiteralPath pathToSolutionFile.wsp

    Remove a solution

    • SharePoint 2007:  stsadm -o deletesolution -name SolutionFile.wsp
    • SharePoint 2010: Remove-SPSolution -Identity SolutionFile.wsp

    Reference:http://www.dev4side.com/community/technical-articles/sharepoint-2010/understand-and-manage-sharepoint-solutions-through-powershell.aspx

  • 相关阅读:
    source insight 4.0.086破解
    Java IO流关闭问题的深入研究
    iOS开发UI篇—UITableview控件使用小结
    iOS开发UI篇—使用纯代码自定义UItableviewcell实现一个简单的微博界面布局
    iOS开发UI篇—使用xib自定义UItableviewcell实现一个简单的团购应用界面布局
    iOS开发UI篇—实现UItableview控件数据刷新
    iOS开发UI篇—使用嵌套模型完成的一个简单汽车图标展示程序
    iOS开发UI篇—推荐两个好用的Xcode插件(提供下载链接)
    iOS开发UI篇—UITableviewcell的性能优化和缓存机制
    iOS开发UI篇—UITableview控件基本使用
  • 原文地址:https://www.cnblogs.com/KingStar/p/1932102.html
Copyright © 2020-2023  润新知