We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b0c4a8 commit c6a67c9Copy full SHA for c6a67c9
Scripts/uninstall-github-cli.ps1
@@ -0,0 +1,29 @@
1
+<#
2
+.SYNOPSIS
3
+ Uninstalls GitHub CLI
4
+.DESCRIPTION
5
+ This PowerShell script uninstalls the GitHub CLI from the local computer.
6
+.EXAMPLE
7
+ PS> ./uninstall-github-cli.ps1
8
+ ⏳ Uninstalling GitHub CLI...
9
+ ✔️ Removal of GitHub CLI took 7 sec
10
+.LINK
11
+ https://github.com/fleschutz/PowerShell
12
+.NOTES
13
+ Author: Markus Fleschutz | License: CC0
14
+#>
15
+
16
+try {
17
+ "⏳ Uninstalling GitHub CLI..."
18
+ $StopWatch = [system.diagnostics.stopwatch]::startNew()
19
20
+ & winget uninstall --id GitHub.cli
21
+ if ($lastExitCode -ne "0") { throw "Can't uninstall GitHub CLI, is it installed?" }
22
23
+ [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
24
+ "✔️ Removal of GitHub CLI took $Elapsed sec"
25
+ exit 0 # success
26
+} catch {
27
+ "Sorry: $($Error[0])"
28
+ exit 1
29
+}
0 commit comments