From 6626a0df8690c17e7a732d675d79c7bfc2bd41a5 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 7 Nov 2023 09:42:58 -0700 Subject: [PATCH] WIP: psscriptanalyzer --- psscriptanalyzer/README.md | 25 +++++++++++++++++++++++++ psscriptanalyzer/install.sh | 15 +++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 psscriptanalyzer/README.md create mode 100644 psscriptanalyzer/install.sh diff --git a/psscriptanalyzer/README.md b/psscriptanalyzer/README.md new file mode 100644 index 0000000..0b57b7b --- /dev/null +++ b/psscriptanalyzer/README.md @@ -0,0 +1,25 @@ +--- +title: PSScriptAnalyzer +homepage: https://github.com/PowerShell/PSScriptAnalyzer +tagline: | + PSScriptAnalyzer is Formatter & Linter for PowerShell. +--- + +To update or switch versions, run `webi psscriptanalyzer`. + +## Cheat Sheet + +### Files + +These are the files / directories that are created and/or modified with this +install: + +```text +~/.local/share/powershell/Modules/ +``` + +## Check the Installed Version + +```pwsh +Get-Module -ListAvailable +``` diff --git a/psscriptanalyzer/install.sh b/psscriptanalyzer/install.sh new file mode 100644 index 0000000..cccde2e --- /dev/null +++ b/psscriptanalyzer/install.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -e +set -x + +__install_psscriptanalyzer() { + echo "Checking for pwsh (PowerShell Core)..." + if ! command -v pwsh > /dev/null; then + "$HOME/.local/bin/webi" pwsh + export PATH="$HOME/.local/opt/pwsh:$PATH" + fi + + pwsh -Command "Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -AllowClobber" +} + +__install_psscriptanalyzer