Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 9440 #43153

Merged
merged 1 commit into from
Dec 2, 2024
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