mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 17:53:58 +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]$Channel = $dotnetCLIChannel,
|
||||||
[string]$Version = $dotnetCLIRequiredVersion,
|
[string]$Version = $dotnetCLIRequiredVersion,
|
||||||
[string]$Quality = $dotnetCLIQuality,
|
[string]$Quality = $dotnetCLIQuality,
|
||||||
|
[switch]$RemovePreviousVersion,
|
||||||
[switch]$NoSudo,
|
[switch]$NoSudo,
|
||||||
[string]$InstallDir,
|
[string]$InstallDir,
|
||||||
[string]$AzureFeed,
|
[string]$AzureFeed,
|
||||||
@ -1821,20 +1822,22 @@ function Install-Dotnet {
|
|||||||
if ($environment.IsLinux -or $environment.IsMacOS) {
|
if ($environment.IsLinux -or $environment.IsMacOS) {
|
||||||
$wget = Get-Command -Name wget -CommandType Application -TotalCount 1 -ErrorAction Stop
|
$wget = Get-Command -Name wget -CommandType Application -TotalCount 1 -ErrorAction Stop
|
||||||
|
|
||||||
# Uninstall all previous dotnet packages
|
# Attempt to uninstall previous dotnet packages if requested
|
||||||
$uninstallScript = if ($environment.IsLinux -and $environment.IsUbuntu) {
|
if ($RemovePreviousVersion) {
|
||||||
"dotnet-uninstall-debian-packages.sh"
|
$uninstallScript = if ($environment.IsLinux -and $environment.IsUbuntu) {
|
||||||
} elseif ($environment.IsMacOS) {
|
"dotnet-uninstall-debian-packages.sh"
|
||||||
"dotnet-uninstall-pkgs.sh"
|
} elseif ($environment.IsMacOS) {
|
||||||
}
|
"dotnet-uninstall-pkgs.sh"
|
||||||
|
}
|
||||||
if ($uninstallScript) {
|
|
||||||
Start-NativeExecution {
|
if ($uninstallScript) {
|
||||||
& $wget $uninstallObtainUrl/uninstall/$uninstallScript
|
Start-NativeExecution {
|
||||||
Invoke-Expression "$sudo bash ./$uninstallScript"
|
& $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"
|
Write-Verbose -Verbose "Invoking install script"
|
||||||
@ -1868,6 +1871,8 @@ function Install-Dotnet {
|
|||||||
$bashArgs += @('-FeedCredential', $FeedCredential)
|
$bashArgs += @('-FeedCredential', $FeedCredential)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$bashArgs += @('-skipnonversionedfiles')
|
||||||
|
|
||||||
$bashArgs | Out-String | Write-Verbose -Verbose
|
$bashArgs | Out-String | Write-Verbose -Verbose
|
||||||
|
|
||||||
Start-NativeExecution {
|
Start-NativeExecution {
|
||||||
@ -1898,6 +1903,8 @@ function Install-Dotnet {
|
|||||||
$installArgs += @{FeedCredential = $FeedCredential}
|
$installArgs += @{FeedCredential = $FeedCredential}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$installArgs += @{ SkipNonVersionedFiles = $true }
|
||||||
|
|
||||||
$installArgs | Out-String | Write-Verbose -Verbose
|
$installArgs | Out-String | Write-Verbose -Verbose
|
||||||
|
|
||||||
& ./$installScript @installArgs
|
& ./$installScript @installArgs
|
||||||
@ -1926,6 +1933,8 @@ function Install-Dotnet {
|
|||||||
$psArgs += @('-FeedCredential', $FeedCredential)
|
$psArgs += @('-FeedCredential', $FeedCredential)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$psArgs += @('-SkipNonVersionedFiles')
|
||||||
|
|
||||||
$psArgs | Out-String | Write-Verbose -Verbose
|
$psArgs | Out-String | Write-Verbose -Verbose
|
||||||
|
|
||||||
Start-NativeExecution {
|
Start-NativeExecution {
|
||||||
|
@ -215,7 +215,7 @@
|
|||||||
"Type": "nuget",
|
"Type": "nuget",
|
||||||
"Nuget": {
|
"Nuget": {
|
||||||
"Name": "Microsoft.Win32.SystemEvents",
|
"Name": "Microsoft.Win32.SystemEvents",
|
||||||
"Version": "6.0.0"
|
"Version": "6.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DevelopmentDependency": false
|
"DevelopmentDependency": false
|
||||||
@ -825,7 +825,7 @@
|
|||||||
"Type": "nuget",
|
"Type": "nuget",
|
||||||
"Nuget": {
|
"Nuget": {
|
||||||
"Name": "System.Diagnostics.PerformanceCounter",
|
"Name": "System.Diagnostics.PerformanceCounter",
|
||||||
"Version": "6.0.0"
|
"Version": "6.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DevelopmentDependency": false
|
"DevelopmentDependency": false
|
||||||
@ -975,7 +975,7 @@
|
|||||||
"Type": "nuget",
|
"Type": "nuget",
|
||||||
"Nuget": {
|
"Nuget": {
|
||||||
"Name": "System.Net.Http.WinHttpHandler",
|
"Name": "System.Net.Http.WinHttpHandler",
|
||||||
"Version": "6.0.0"
|
"Version": "6.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DevelopmentDependency": false
|
"DevelopmentDependency": false
|
||||||
|
Loading…
Reference in New Issue
Block a user