mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 09:43:57 +08:00
Allow multiple installations of dotnet. (#17141)
* Allow multiple installations of dotnet. A new flag for removal is now provided, but by default we will add a new version of dotnet. * Add updated CG manifest.
This commit is contained in:
parent
4acf6b39d4
commit
9c13c0494f
35
build.psm1
35
build.psm1
@ -1801,6 +1801,7 @@ function Install-Dotnet {
|
||||
[string]$Channel = $dotnetCLIChannel,
|
||||
[string]$Version = $dotnetCLIRequiredVersion,
|
||||
[string]$Quality = $dotnetCLIQuality,
|
||||
[switch]$RemovePreviousVersion,
|
||||
[switch]$NoSudo,
|
||||
[string]$InstallDir,
|
||||
[string]$AzureFeed,
|
||||
@ -1821,20 +1822,22 @@ function Install-Dotnet {
|
||||
if ($environment.IsLinux -or $environment.IsMacOS) {
|
||||
$wget = Get-Command -Name wget -CommandType Application -TotalCount 1 -ErrorAction Stop
|
||||
|
||||
# Uninstall all previous dotnet packages
|
||||
$uninstallScript = if ($environment.IsLinux -and $environment.IsUbuntu) {
|
||||
"dotnet-uninstall-debian-packages.sh"
|
||||
} elseif ($environment.IsMacOS) {
|
||||
"dotnet-uninstall-pkgs.sh"
|
||||
}
|
||||
|
||||
if ($uninstallScript) {
|
||||
Start-NativeExecution {
|
||||
& $wget $uninstallObtainUrl/uninstall/$uninstallScript
|
||||
Invoke-Expression "$sudo bash ./$uninstallScript"
|
||||
# Attempt to uninstall previous dotnet packages if requested
|
||||
if ($RemovePreviousVersion) {
|
||||
$uninstallScript = if ($environment.IsLinux -and $environment.IsUbuntu) {
|
||||
"dotnet-uninstall-debian-packages.sh"
|
||||
} elseif ($environment.IsMacOS) {
|
||||
"dotnet-uninstall-pkgs.sh"
|
||||
}
|
||||
|
||||
if ($uninstallScript) {
|
||||
Start-NativeExecution {
|
||||
& $wget $uninstallObtainUrl/uninstall/$uninstallScript
|
||||
Invoke-Expression "$sudo bash ./$uninstallScript"
|
||||
}
|
||||
} else {
|
||||
Write-Warning "This script only removes prior versions of dotnet for Ubuntu and OS X"
|
||||
}
|
||||
} else {
|
||||
Write-Warning "This script only removes prior versions of dotnet for Ubuntu and OS X"
|
||||
}
|
||||
|
||||
Write-Verbose -Verbose "Invoking install script"
|
||||
@ -1868,6 +1871,8 @@ function Install-Dotnet {
|
||||
$bashArgs += @('-FeedCredential', $FeedCredential)
|
||||
}
|
||||
|
||||
$bashArgs += @('-skipnonversionedfiles')
|
||||
|
||||
$bashArgs | Out-String | Write-Verbose -Verbose
|
||||
|
||||
Start-NativeExecution {
|
||||
@ -1898,6 +1903,8 @@ function Install-Dotnet {
|
||||
$installArgs += @{FeedCredential = $FeedCredential}
|
||||
}
|
||||
|
||||
$installArgs += @{ SkipNonVersionedFiles = $true }
|
||||
|
||||
$installArgs | Out-String | Write-Verbose -Verbose
|
||||
|
||||
& ./$installScript @installArgs
|
||||
@ -1926,6 +1933,8 @@ function Install-Dotnet {
|
||||
$psArgs += @('-FeedCredential', $FeedCredential)
|
||||
}
|
||||
|
||||
$psArgs += @('-SkipNonVersionedFiles')
|
||||
|
||||
$psArgs | Out-String | Write-Verbose -Verbose
|
||||
|
||||
Start-NativeExecution {
|
||||
|
@ -215,7 +215,7 @@
|
||||
"Type": "nuget",
|
||||
"Nuget": {
|
||||
"Name": "Microsoft.Win32.SystemEvents",
|
||||
"Version": "6.0.0"
|
||||
"Version": "6.0.1"
|
||||
}
|
||||
},
|
||||
"DevelopmentDependency": false
|
||||
@ -825,7 +825,7 @@
|
||||
"Type": "nuget",
|
||||
"Nuget": {
|
||||
"Name": "System.Diagnostics.PerformanceCounter",
|
||||
"Version": "6.0.0"
|
||||
"Version": "6.0.1"
|
||||
}
|
||||
},
|
||||
"DevelopmentDependency": false
|
||||
@ -975,7 +975,7 @@
|
||||
"Type": "nuget",
|
||||
"Nuget": {
|
||||
"Name": "System.Net.Http.WinHttpHandler",
|
||||
"Version": "6.0.0"
|
||||
"Version": "6.0.1"
|
||||
}
|
||||
},
|
||||
"DevelopmentDependency": false
|
||||
|
Loading…
Reference in New Issue
Block a user