zoukankan      html  css  js  c++  java
  • SharePoint PowerShell部署开发好的WebPart到服务器上

    内容仅供参考,需结合实际需求来处理。

    =========SharePoint 环境下运行ps1文件,ps1内容如下=======

     1 Set-ExecutionPolicy ByPass
     2 Add-PSSnapin Microsoft.SharePoint.PowerShell
     3  
     4 Add-SPSolution -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_Lib.wsp"
     5 Add-SPSolution -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_FilterOfStaffList.wsp"
     6 Add-SPSolution -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_Lookup_ListRelation.wsp"
     7  
     8 Install-SPSolution -Identity Custom_Lib.wsp -WebApplication http://win2012sp2013:1000/
     9 Install-SPSolution -Identity Custom_WP_FilterOfStaffList.wsp -WebApplication http://win2012sp2013:1000/
    10 Install-SPSolution -Identity Custom_Lookup_ListRelation.wsp -WebApplication http://win2012sp2013:1000/
    11  
    12  
    13 Update-SPSolution -Identity Custom_ContentType.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_ContentType.wsp" -GACDeployment
    14 Update-SPSolution -Identity Custom_RB_StaffList.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_RB_StaffList.wsp" -GACDeployment
    15 Update-SPSolution -Identity Custom_WP_RBPermissionOfStaffList.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_RBPermissionOfStaffList.wsp" -GACDeployment
    16 Update-SPSolution -Identity Custom_WP_SearchStaffList.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_SearchStaffList.wsp" -GACDeployment
    17 Update-SPSolution -Identity Custom_WP_SeatingPlan.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_SeatingPlan.wsp" -GACDeployment
    18 Update-SPSolution -Identity Custom_WP_StaffSearch.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_StaffSearch.wsp" -GACDeployment
    19 Update-SPSolution -Identity Custom_WP_IconandSloganbanner.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_IconandSloganbanner.wsp" -GACDeployment
    20 Update-SPSolution -Identity Custom_WP_NewAndEvent.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_NewAndEvent.wsp" -GACDeployment
    21 Update-SPSolution -Identity Custom_WP_DocumentSharing.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_DocumentSharing.wsp" -GACDeployment
    22 Update-SPSolution -Identity Custom_WP_TrainingCenter.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_TrainingCenter.wsp" -GACDeployment
    23 Update-SPSolution -Identity Custom_WP_ImageBanner.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_ImageBanner.wsp" -GACDeployment
    24 Update-SPSolution -Identity Custom_WP_OnlineSurvey.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_OnlineSurvey.wsp" -GACDeployment
    25 Update-SPSolution -Identity Custom_WP_NewsArticles.wsp -LiteralPath "C:Deploy_2013-08-21_v2.2WSPCustom_WP_NewsArticles.wsp" -GACDeployment

    另外有用的语句:

    1 Uninstall-SPSolution –Identity Clone_List_Scheduler.wsp
    2 Remove-SPSolution -Identity Clone_List_Scheduler.wsp
     

    使用Windows Powershell ISE 64位,附加SharePoint环境的dll
     1 write-host 
     2 write-host "Loading PowerShell environment for SharePoint" -foregroundcolor Green
     3 write-host 
     4 # unload & load the sharepoint powershell snapin
     5 $snapin = Get-PSSnapin | where-object { $_.Name -eq 'Microsoft.SharePoint.PowerShell' }
     6 if ($snapin -ne $null){
     7  write-host "Unloading SharePoint PowerShell Snapin..." -foregroundcolor Blue
     8  remove-pssnapin "Microsoft.SharePoint.PowerShell"
     9  write-host "SharePoint PowerShell Snapin unloaded." -foregroundcolor Green
    10 }
    11 $snapin = Get-PSSnapin | where-object { $_.Name -eq 'Microsoft.SharePoint.PowerShell' }
    12 if ($snapin -eq $null){
    13  write-host "Loading SharePoint PowerShell Snapin..." -foregroundcolor Blue
    14  add-pssnapin "Microsoft.SharePoint.PowerShell"
    15  write-host "SharePoint PowerShell Snapin loaded." -foregroundcolor Green
    16 }
  • 相关阅读:
    Java并发指南3:并发三大问题与volatile关键字,CAS操作
    Java并发指南2:深入理解Java内存模型JMM
    Java并发指南1:并发基础与Java多线程
    Java集合详解8:Java集合类细节精讲,细节决定成败
    Java集合详解7:一文搞清楚HashSet,TreeSet与LinkedHashSet的异同
    Java集合详解6:这次,从头到尾带你解读Java中的红黑树
    IP电话的配置
    孤立账户
    服务器维护知识
    VB学习一
  • 原文地址:https://www.cnblogs.com/huangjianwu/p/4538237.html
Copyright © 2011-2022 走看看