add PowerShell examples

This commit is contained in:
Chrissy LeMaire 2020-10-07 22:49:16 +02:00
parent d606e039ae
commit 38bf08d269

View file

@ -17,6 +17,7 @@
- [Node - Yarn 2](#node---yarn-2)
- [OCaml/Reason - esy](#ocamlreason---esy)
- [PHP - Composer](#php---composer)
- [PowerShell](#powershell)
- [Python - pip](#python---pip)
- [Simple example](#simple-example)
- [Multiple OSes in a workflow](#multiple-oss-in-a-workflow)
@ -295,6 +296,30 @@ Esy allows you to export built dependencies and import pre-built dependencies.
${{ runner.os }}-composer-
```
## PowerShell
For PowerShell, the cache directory will vary by OS.
Locations:
- Ubuntu: `~/.local/share/powershell/Modules`
- Windows: `~\Documents\PowerShell\Modules`
- macOS: `~/.local/share/powershell/Modules`
```yaml
- name: Get PowerShell Cache Directory
id: powershell-cache
- uses: actions/cache@v2
with:
path: "~/.local/share/powershell/Modules"
key: ${{ runner.os }}-PS-SqlServer-PSScriptAnalyzer
- name: Install PowerShell modules
if: steps.powershell-cache.outputs.cache-hit != 'true'
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module SqlServer, PSScriptAnalyzer -ErrorAction Stop
```
## Python - pip
For pip, the cache directory will vary by OS. See https://pip.pypa.io/en/stable/reference/pip_install/#caching