diff --git a/Data/scripts.csv b/Data/scripts.csv index 3c4fc5fa..9147d6be 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -82,6 +82,7 @@ install-knot-resolver.ps1, Installs the Knot Resolver (needs admin rights) install-signal-cli.ps1, Installs signal-cli from github.com/AsamK/signal-cli install-ssh-client.ps1, Installs the SSH client (needs admin rights) install-ssh-server.ps1, Installs the SSH server (needs admin rights) +install-updates.ps1, Installs updates (needs admin rights) install-vscode.ps1, Installs Visual Studio Code install-wsl.ps1, Installs Windows Subsystem for Linux (WSL), needs admin rights introduce-powershell.ps1, Introduces PowerShell to new users diff --git a/README.md b/README.md index 0fe68749..c23a9f7a 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Mega Collection of PowerShell Scripts | [install-ssh-client.ps1](Scripts/install-ssh-client.ps1) | Installs the SSH client (needs admin rights) | [Help](Docs/install-ssh-client.ps1.md) | | [install-ssh-server.ps1](Scripts/install-ssh-server.ps1) | Installs the SSH server (needs admin rights) | [Help](Docs/install-ssh-server.ps1.md) | | [install-signal-cli.ps1](Scripts/install-signal-cli.ps1) | Installs signal-cli from github.com/AsamK/signal-cli | [Help](Docs/install-signal-cli.ps1.md) | +| [install-updates.ps1](Scripts/install-updates.ps1) | Installs updates (need admin rights) | [Help](Docs/install-updates.ps1.md) | | [install-vscode.ps1](Scripts/install-vscode.ps1) | Installs Visual Studio Code | [Help](Docs/install-vscode.ps1.md) | | [install-wsl.ps1](Scripts/install-wsl.ps1) | Installs Windows Subsystem for Linux (WSL), needs admin rights | [Help](Docs/install-wsl.ps1.md) | | [list-cli-tools.ps1](Scripts/list-cli-tools.ps1) | Lists available command-line interface (CLI) tools | [Help](Docs/list-cli-tools.ps1.md) | diff --git a/Scripts/install-updates.ps1 b/Scripts/install-updates.ps1 new file mode 100755 index 00000000..e6ff94bd --- /dev/null +++ b/Scripts/install-updates.ps1 @@ -0,0 +1,31 @@ +<# +.SYNOPSIS + install-updates.ps1 +.DESCRIPTION + Installs updates (needs admin rights) +.EXAMPLE + PS> .\install-updates.ps1 +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +#Requires -RunAsAdministrator + +try { + $StopWatch = [system.diagnostics.stopwatch]::startNew() + + if ($IsLinux) { + apt update && apt upgrade && apt autoremove && snap refresh + } else { + "Sorry, not supported yet" + } + + [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds + "✔️ installed updates in $Elapsed sec" + exit 0 +} catch { + "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" + exit 1 +}