mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-26 06:52:15 +02:00
Added install-edit.ps1
This commit is contained in:
parent
d29697c7a1
commit
58a6d84015
29
scripts/install-edit.ps1
Normal file
29
scripts/install-edit.ps1
Normal file
@ -0,0 +1,29 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs Edit
|
||||
.DESCRIPTION
|
||||
This PowerShell script installs Microsoft Edit.
|
||||
.EXAMPLE
|
||||
PS> ./install-edit.ps1
|
||||
⏳ Installing Microsoft Edit from Microsoft Store...
|
||||
✅ Microsoft Edit installed successfully in 25s.
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
"⏳ Installing Microsoft Edit from Microsoft Store..."
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
& winget install --id Microsoft.Edit --accept-package-agreements --accept-source-agreements
|
||||
if ($lastExitCode -ne 0) { throw "Can't install Microsoft Edit, is it already installed?" }
|
||||
|
||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
"✅ Microsoft Edit installed successfully in $($elapsed)s."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ ERROR: $($Error[0])"
|
||||
exit 1
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user