mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-26 15:01:56 +02:00
Updated install-edit.ps1
This commit is contained in:
parent
5ea38da16e
commit
74ff3721ea
@ -14,12 +14,17 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
"⏳ Installing Microsoft Edit from Microsoft Store..."
|
|
||||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
& winget install --id Microsoft.Edit --accept-package-agreements --accept-source-agreements
|
if ($IsLinux) {
|
||||||
if ($lastExitCode -ne 0) { throw "Can't install Microsoft Edit, is it already installed?" }
|
"⏳ Installing Microsoft Edit from Snap Store..."
|
||||||
|
& sudo snap install msedit
|
||||||
|
if ($lastExitCode -ne 0) { throw "Can't install Microsoft Edit, is it already installed?" }
|
||||||
|
} else {
|
||||||
|
"⏳ Installing Microsoft Edit from Microsoft Store..."
|
||||||
|
& 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
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✅ Microsoft Edit installed successfully in $($elapsed)s."
|
"✅ Microsoft Edit installed successfully in $($elapsed)s."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
Loading…
x
Reference in New Issue
Block a user