From 1243b291480b7af4b38d18a3daefc5d77bed07ed Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:23:35 -0800 Subject: [PATCH] Hide output from register/unregister ps module repository (#6272) Co-authored-by: Ben Broderick Phillips --- eng/common/scripts/Helpers/PSModule-Helpers.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/common/scripts/Helpers/PSModule-Helpers.ps1 b/eng/common/scripts/Helpers/PSModule-Helpers.ps1 index 0c825cb706..34dac96f8b 100644 --- a/eng/common/scripts/Helpers/PSModule-Helpers.ps1 +++ b/eng/common/scripts/Helpers/PSModule-Helpers.ps1 @@ -79,7 +79,7 @@ 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." @@ -87,7 +87,7 @@ function installModule([string]$moduleName, [string]$version, $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" @@ -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] }