File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments