Files
vim-ale/pwsh
AJ ONeal 23100394ac ref(installerconf): rename config keys and add full URL support
Renames:
- github_repo → github_releases (back-compat kept)
- github_source → github_sources (back-compat kept)
- gitea_repo → gitea_releases (back-compat kept)

New keys:
- gitea_sources, gitlab_releases, gitlab_sources

All keys now accept either owner/repo shorthand or full URLs:
- github_releases = sharkdp/bat
- github_releases = https://github.com/sharkdp/bat
- gitea_releases = https://git.rootprojects.org/root/pathman

Defaults: github → github.com, gitlab → gitlab.com.
Gitea has no default (self-hosted only).

Updated all 73 releases.conf files from github_repo to github_releases.
2026-03-11 11:51:43 -06:00
..
2026-03-08 19:38:49 -06:00

title, homepage, tagline
title homepage tagline
Microsoft PowerShell Core https://docs.microsoft.com/powershell/ PowerShell Core is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework.

To update or switch versions, run webi pwsh@stable (or @v7.4, @beta, etc).

Cheat Sheet

The core benefit of running pwsh on Mac or Linux is that you get a way to debug Windows scripts without having to boot up Windows.

The core benefit of running pwsh on Windows is that it's years ahead of pre-installed version.

For example, if you want to create a curl.exe | powershell script for Windows (as we do), it's helpful to be able to do some level of debugging on other platforms.

Table of Contents

  • Files
  • ProTips
  • vim
  • lint
  • fmt

Files

These are the files / directories that are created and/or modified with this install:

~/.config/envman/PATH.env
~/.local/opt/pwsh/
~/.local/share/powershell/Modules/
~/.local/opt/pwsh/Modules/

ProTip: pwsh-essentials

Friends don't let friends PowerShell without pwsh-essentials:

Plus, important information for anyone Getting Started with PowerShell:

  • Case-Sensitivity
  • Returns vs Pipeline Streams
  • Strict, Trace, & Verbose Modes
  • The Call Operator "&"
  • curl vs curl.exe
  • Script Policies & Preferences

How to Use PowerShell with Vim

Assuming you have vim-ale installed - which is included with vim-essentials - all you need to do is install the PSScriptAnalyzer module.

See the "Lint & Fmt" section below.

How to Use PowerShell with VSCode

VS Code should also automatically recognize and use PSScriptAnalyzer.

How to Lint, Fmt, & Fix ps1 Files

See pwsh-essentials for more info but, in short:

pwsh -Command "Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -AllowClobber"
my_ps1='./my-file.ps1'
pwsh -Command "Invoke-ScriptAnalyzer -Fix -ExcludeRule PSAvoidUsingWriteHost -Path '$my_ps1'"

To fmt:

my_ps1='./my-file.ps1'
my_text="$(
    pwsh -Command "Invoke-Formatter -ScriptDefinition (Get-Content -Path '$my_ps1' -Raw)"
)"
printf '%s\n' "${my_text}" > "${my_ps1}"

Note: it is several hundred times faster to lint and fmt from a native PowerShell script than from invoking pwsh -Command each time.