I have a script in which I add a solution and then install it. The script runs fine and the solution is added and deployed, and it looks like this:
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"
However because the Add-SPSolution
command outputs right after it finishes, I get the following output:
Name SolutionId Deployed
---- ---------- --------
{SOLUTION NAME} {GUID} False
Solution added and deployed
Although there's a 2nd line saying the solution is deployed, I want to disable the output from Add-SPSolution
to not induce the user in error. How can I do it?
EDIT I was unaware that we could store the output from Add-SPSolution
in a variable, which the OP from the supposed duplicate answer was aware of, so I don't think my question classifies as duplicate.