upgrade to powershellget 2.2.5

This commit is contained in:
Rui Lopes
2026-09-02 07:00:02 +00:00
parent f46a5bd8d4
commit ef3b8137d7
6 changed files with 67 additions and 17 deletions
@@ -0,0 +1,6 @@
# install chocolatey.
# see https://community.chocolatey.org/packages/chocolatey
# renovate: datasource=nuget:chocolatey depName=chocolatey
$chocolateyVersion = '2.7.4'
$env:chocolateyVersion = $chocolateyVersion
Invoke-Expression ((New-Object Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
@@ -0,0 +1,35 @@
# install PowerShellGet v2.
# NB we cannot uninstall the built-in modules.
# see https://learn.microsoft.com/en-us/powershell/gallery/powershellget/install-powershellget?view=powershellget-2.x
$nugetPackageProviderVersion = '2.8.5.208'
Write-Host "Installing the NuGet $nugetPackageProviderVersion provider..."
Install-PackageProvider `
-Name NuGet `
-RequiredVersion $nugetPackageProviderVersion `
-Force `
| Format-List
# see https://community.chocolatey.org/packages/nuget.commandline
# renovate: datasource=nuget:chocolatey depName=nuget.commandline
$nugetVersion = '7.9.0'
Write-Host "Installing nuget $nugetVersion and configuring PowerShellGet to use it..."
choco install -y nuget.commandline --version $nugetVersion
$psGetNugetPath = 'C:\ProgramData\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe'
mkdir (Split-Path -Parent $psGetNugetPath) | Out-Null
New-Item `
-ItemType SymbolicLink `
-Path $psGetNugetPath `
-Target 'C:\ProgramData\chocolatey\lib\NuGet.CommandLine\tools\NuGet.exe' `
| Out-Null
# see https://www.powershellgallery.com/packages/PowerShellGet
# renovate: datasource=nuget:powershellgallery depName=PowerShellGet
$powerShellGetModuleVersion = '2.2.5'
Write-Host "Installing PowerShellGet $powerShellGetModuleVersion..."
Install-Module `
-Repository PSGallery `
-Name PowerShellGet `
-RequiredVersion $powerShellGetModuleVersion `
-AllowClobber `
-Force
@@ -2,9 +2,6 @@ param(
[string]$nexusDomain = 'nexus.example.com'
)
# install chocolatey.
Invoke-Expression ((New-Object Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Write-Host 'Default Chocolatey sources:'
choco sources list
@@ -10,7 +10,6 @@ Get-PSRepository
Write-Host 'Configuring PowerShell to only use the nexus server...'
Get-PSRepository | Unregister-PSRepository
Install-PackageProvider NuGet -Force
Register-PSRepository `
-Name nexus `
-SourceLocation https://$nexusDomain/repository/powershell-group/ `
@@ -20,19 +19,6 @@ Register-PSRepository `
Write-Host 'Current PowerShell sources:'
Get-PSRepository
Write-Host 'Installing the Sql Server module from the nexus server...'
Install-Module SqlServer
Write-Host 'Installing nuget and configuring PowerShellGet to use it...'
choco install -y nuget.commandline
$psGetNugetPath = 'C:\ProgramData\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe'
mkdir (Split-Path -Parent $psGetNugetPath) | Out-Null
New-Item `
-ItemType SymbolicLink `
-Path $psGetNugetPath `
-Target 'C:\ProgramData\chocolatey\lib\NuGet.CommandLine\tools\NuGet.exe' `
| Out-Null
Write-Host 'Publishing the ExampleGreeter module into the nexus server...'
Set-Location $env:TEMP
mkdir ExampleGreeter | Out-Null