mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-13 22:38:46 +02:00
Updated the manuals
This commit is contained in:
74
docs/install-edit.md
Normal file
74
docs/install-edit.md
Normal file
@ -0,0 +1,74 @@
|
||||
The *install-edit.ps1* Script
|
||||
===========================
|
||||
|
||||
This PowerShell script installs Microsoft Edit.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
/Repos/PowerShell/scripts/install-edit.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./install-edit.ps1
|
||||
⏳ Installing Microsoft Edit from Microsoft Store...
|
||||
✅ Microsoft Edit installed successfully (took 25s).
|
||||
|
||||
```
|
||||
|
||||
Notes
|
||||
-----
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
Related Links
|
||||
-------------
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
Script Content
|
||||
--------------
|
||||
```powershell
|
||||
<#
|
||||
.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 (took 25s).
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
#requires -version 5.1
|
||||
|
||||
try {
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if ($IsLinux) {
|
||||
"⏳ 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
|
||||
"✅ Microsoft Edit installed successfully (took $($elapsed)s)."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ ERROR: $($Error[0]) in script line $($_.InvocationInfo.ScriptLineNumber)."
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*(page generated by convert-ps2md.ps1 as of 08/06/2025 15:18:22)*
|
Reference in New Issue
Block a user