Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading