doc(pwsh): update modules dirs, add ToC

This commit is contained in:
AJ ONeal
2023-11-11 23:29:32 -07:00
parent 079035fe56
commit ee65e50f54
+24 -12
View File
@@ -7,17 +7,6 @@ tagline: |
To update or switch versions, run `webi pwsh@stable` (or `@v7.4`, `@beta`, etc).
### Files
These are the files / directories that are created and/or modified with this
install:
```text
~/.config/envman/PATH.env
~/.local/opt/pwsh/
~/.local/share/powershell/Modules
```
## Cheat Sheet
> The core benefit of running `pwsh` on Mac or Linux is that you get a way to
@@ -27,6 +16,25 @@ For example, if you want to create a `curl.exe -A "windows" | 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
- vim
- lint
- fmt
### Files
These are the files / directories that are created and/or modified with this
install:
```text
~/.config/envman/PATH.env
~/.local/opt/pwsh/
~/.local/share/powershell/Modules/
~/.local/opt/pwsh/Modules/
```
### How to Use PowerShell with Vim
Assuming you have [vim-ale](../vim-ale/) installed - which is included with
@@ -35,6 +43,10 @@ Assuming you have [vim-ale](../vim-ale/) installed - which is included with
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 ps1 Files
You must install `PSScriptAnalyzer`. Then you can use `Invoke-ScriptAnalyzer`
@@ -48,7 +60,7 @@ To lint:
```sh
my_ps1='./my-file.ps1'
pwsh -Command "Invoke-ScriptAnalyzer -Fix -ExcludeRule PSAvoidUsingWriteHost, PSUseDeclaredVarsMoreThanAssignment -Path \"$my_ps1\""
pwsh -Command "Invoke-ScriptAnalyzer -Fix -ExcludeRule PSAvoidUsingWriteHost -Path \"$my_ps1\""
```
To fmt: