【发布时间】:2011-09-13 14:53:09
【问题描述】:
我有一个文件夹,其中包含我想要添加和安装的 SharePoint 应用程序的多个解决方案。我想遍历文件夹中的元素,然后使用 Add-SPSolution。之后,我想在使用 Install-SPSolution 之前检查解决方案是否已完成部署。这是我目前正在研究的一个 sn-p:
# Get the location of the folder you are currently in
$dir = $(gl)
# Create a list with the .wsp solutions
$list = Get-ChildItem $dir | where {$_.extension -eq ".wsp"}
Write-Host 'DEPLOYING SOLUTIONS...'
foreach($my_file in Get-ChildItem $list){Add-SPSolution -LiteralPath $my_file.FullName}
Write-Host 'SLEEP FOR 30 SECONDS'
Start-Sleep -s 30
Write-Host 'INSTALLING SOLUTIONS...'
foreach($my_file in Get-ChildItem $list){Install-SPSolution -Identity $my_file.Name -AllWebApplications -GACDeployment}
有没有办法检查部署是否完成,是否准备好开始安装解决方案?
【问题讨论】:
标签: sharepoint powershell