代码之家  ›  专栏  ›  技术社区  ›  Tangiest

使用PowerShell检索SharePoint中已部署解决方案的详细信息

  •  4
  • Tangiest  · 技术社区  · 16 年前

    4 回复  |  直到 16 年前
        1
  •  8
  •   Mitchell Skurnik    16 年前

    这其实很容易做到。您连接到SP场,只需请求get_解决方案。

    以下是一个例子:

    # Connect to the Farm
    $SPfarm = [Microsoft.SharePoint.Administration.SPFarm]::get_Local()
    
    # What Solution are we looking for?
    $solution = "sharepointlearningkit.wsp";
    
    # Get the solutions
    $currentSolution = $SPfarm.get_Solutions() | Where-Object { $_.DisplayName -eq $solution; }
    $currentSolution;
    
        2
  •  3
  •   Community Mohan Dere    9 年前

    Mitchell's answer ,我曾使用:

        [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    
        function Get-LocalSPFarm()
        {
           return [Microsoft.SharePoint.Administration.SPFarm]::Local
        }
    
        function List-Solutions()
        {
            $farm = Get-LocalSPFarm        
            foreach ($solution in $farm.Solutions) 
            {
                Write-Host($solution.DisplayName)
                # Get-Member -InputObject $solution -MemberType property
            }
        }
    

        3
  •  2
  •   naivists    16 年前

    你可以打电话 stsadm.exe -o enumsolutions 从您的powershell脚本。它返回可以轻松转换为的XML数据 [xml]
    (stsadm住在伦敦 c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin )

    <Solution Name="yoursolution.wsp">
      <Id>ab693dcd-6483-45ad-abba-9c996c67b6e0</Id>
      <File>yoursolution.wsp</File>
      <Deployed>TRUE</Deployed>
      <WebApplicationSpecific>TRUE</WebApplicationSpecific>
      <ContainsGlobalAssembly>TRUE</ContainsGlobalAssembly>
      <ContainsCodeAccessSecurityPolicy>FALSE</ContainsCodeAccessSecurityPolicy>
      <Deployment WebApplication="http://devserver/" />
      <LastOperationResult>DeploymentSucceeded</LastOperationResult>
      <LastOperationTime>10/26/2009 9:06 AM</LastOperationTime>
    </Solution>
    
        4
  •  1
  •   Community Mohan Dere    6 年前

    在SP2010管理壳中

    列出所有解决方案。返回解决方案名称、id和部署状态

    获得解决方案

    列出特定解决方案的所有属性

    获取spsolution-标识|选择*

    获取spsolution | select*| out文件c:\solutions.txt

    推荐文章