Skip to content

Commit 1f6e013

Browse files
committed
Add dotnet uninstall scripts
1 parent a026035 commit 1f6e013

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
sudo apt remove 'dotnet*'
4+
sudo apt remove 'aspnetcore*'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Write-Output "Starting .NET uninstall on Windows..."
2+
3+
$uninstallToolPath = "C:\Program Files\dotnet-core-uninstall\dotnet-core-uninstall.exe"
4+
$uninstallToolDownloadUrl = "https://aka.ms/dotnet-core-uninstall-tool-win"
5+
6+
# Install uninstall tool
7+
Write-Output "Downloading .NET Uninstall Tool..."
8+
$zipPath = "$env:TEMP\dotnet-core-uninstall-tool.zip"
9+
Invoke-WebRequest -Uri $uninstallToolDownloadUrl -OutFile $zipPath
10+
11+
Write-Output "Extracting..."
12+
Expand-Archive -Path $zipPath -DestinationPath "C:\Program Files\dotnet-core-uninstall" -Force
13+
Remove-Item $zipPath
14+
15+
# Perform uninstall
16+
Write-Output "Removing all SDKs and runtimes..."
17+
& "$uninstallToolPath" remove --all
18+
19+
Write-Output ".NET uninstall process completed."

0 commit comments

Comments
 (0)