You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
604 B
PowerShell
26 lines
604 B
PowerShell
Write-Host $args[0]
|
|
|
|
$os = $args[0]
|
|
|
|
$linuxDotnetPaths = @("/usr/share/dotnet")
|
|
$macOSDotnetPaths = @("/Users/runner/.dotnet")
|
|
$windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", "$env:ProgramFiles\dotnet/*")
|
|
|
|
$pathsToClear = @()
|
|
|
|
if ($os -eq "Linux") {
|
|
$pathsToClear = $linuxDotnetPaths
|
|
} elseif ($os -eq "macOS") {
|
|
$pathsToClear = $macOSDotnetPaths
|
|
} elseif ($os -eq "Windows") {
|
|
$pathsToClear = $windowsDotnetPaths
|
|
}
|
|
|
|
foreach ($path in $pathsToClear) {
|
|
if (Test-Path $path) {
|
|
Write-Host "Clear $path"
|
|
Remove-Item $path -Recurse -Force
|
|
}
|
|
}
|
|
|
|
dotnet --info |