File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Installs Edit
4+ . DESCRIPTION
5+ This PowerShell script installs Microsoft Edit.
6+ . EXAMPLE
7+ PS> ./install-edit.ps1
8+ ⏳ Installing Microsoft Edit from Microsoft Store...
9+ ✅ Microsoft Edit installed successfully in 25s.
10+ . LINK
11+ https://github.com/fleschutz/PowerShell
12+ . NOTES
13+ Author: Markus Fleschutz | License: CC0
14+ #>
15+
16+ try {
17+ " ⏳ Installing Microsoft Edit from Microsoft Store..."
18+ $stopWatch = [system.diagnostics.stopwatch ]::startNew()
19+
20+ & winget install -- id Microsoft.Edit -- accept- package- agreements -- accept- source- agreements
21+ if ($lastExitCode -ne 0 ) { throw " Can't install Microsoft Edit, is it already installed?" }
22+
23+ [int ]$elapsed = $stopWatch.Elapsed.TotalSeconds
24+ " ✅ Microsoft Edit installed successfully in $ ( $elapsed ) s."
25+ exit 0 # success
26+ } catch {
27+ " ⚠️ ERROR: $ ( $Error [0 ]) "
28+ exit 1
29+ }
You can’t perform that action at this time.
0 commit comments