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