Skip to content

Commit

Permalink
Hide output from register/unregister ps module repository (#6272)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Broderick Phillips <[email protected]>
  • Loading branch information
azure-sdk and benbp authored Dec 2, 2024
1 parent 4efb0fc commit 1243b29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eng/common/scripts/Helpers/PSModule-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ function installModule([string]$moduleName, [string]$version, $repoUrl) {
$repo = (Get-PSRepository).Where({ $_.SourceLocation -eq $repoUrl })
if ($repo.Count -eq 0)
{
Register-PSRepository -Name $repoUrl -SourceLocation $repoUrl -InstallationPolicy Trusted
Register-PSRepository -Name $repoUrl -SourceLocation $repoUrl -InstallationPolicy Trusted | Out-Null
$repo = (Get-PSRepository).Where({ $_.SourceLocation -eq $repoUrl })
if ($repo.Count -eq 0) {
throw "Failed to register package repository $repoUrl."
}
}

if ($repo.InstallationPolicy -ne "Trusted") {
Set-PSRepository -Name $repo.Name -InstallationPolicy "Trusted"
Set-PSRepository -Name $repo.Name -InstallationPolicy "Trusted" | Out-Null
}

Write-Host "Installing module $moduleName with min version $version from $repoUrl"
Expand All @@ -104,7 +104,7 @@ function installModule([string]$moduleName, [string]$version, $repoUrl) {

# Unregister repository as it can cause overlap issues with `dotnet tool install`
# commands using the same devops feed
Unregister-PSRepository -Name $repoUrl
Unregister-PSRepository -Name $repoUrl | Out-Null

return $modules[0]
}
Expand Down

0 comments on commit 1243b29

Please sign in to comment.