Skip to content

Commit 82e5682

Browse files
azure-sdkbenbp
andauthored
Hide output from register/unregister ps module repository (Azure#38750)
Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent c67103e commit 82e5682

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

eng/common/scripts/Helpers/PSModule-Helpers.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ function installModule([string]$moduleName, [string]$version, $repoUrl) {
7979
$repo = (Get-PSRepository).Where({ $_.SourceLocation -eq $repoUrl })
8080
if ($repo.Count -eq 0)
8181
{
82-
Register-PSRepository -Name $repoUrl -SourceLocation $repoUrl -InstallationPolicy Trusted
82+
Register-PSRepository -Name $repoUrl -SourceLocation $repoUrl -InstallationPolicy Trusted | Out-Null
8383
$repo = (Get-PSRepository).Where({ $_.SourceLocation -eq $repoUrl })
8484
if ($repo.Count -eq 0) {
8585
throw "Failed to register package repository $repoUrl."
8686
}
8787
}
8888

8989
if ($repo.InstallationPolicy -ne "Trusted") {
90-
Set-PSRepository -Name $repo.Name -InstallationPolicy "Trusted"
90+
Set-PSRepository -Name $repo.Name -InstallationPolicy "Trusted" | Out-Null
9191
}
9292

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

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

109109
return $modules[0]
110110
}

0 commit comments

Comments
 (0)