【发布时间】:2016-05-26 14:08:27
【问题描述】:
我有一个脚本,我在其中添加了一个解决方案,然后安装它。脚本运行良好,添加并部署了解决方案,如下所示:
param([string]$LiteralPath)
if([string]::IsNullOrEmpty($LiteralPath)){
Write-Error "ERROR: Please include the path to the WSP file"
return
}
Add-SPSolution -LiteralPath $LiteralPath -Confirm:$false
Install-SPSolution -Identity {GUID} -GACDeployment -AllWebApplications
Write-Host "Solution added and deployed"
但是,因为Add-SPSolution 命令在完成后立即输出,所以我得到以下输出:
Name SolutionId Deployed
---- ---------- --------
{SOLUTION NAME} {GUID} False
Solution added and deployed
虽然有第二行说解决方案已部署,但我想禁用Add-SPSolution 的输出,以免导致用户出错。我该怎么做?
编辑我不知道我们可以将Add-SPSolution 的输出存储在一个变量中,the supposed duplicate answer 的 OP 知道这个变量,所以我认为我的问题没有被归类为重复.
【问题讨论】:
标签: powershell sharepoint