A collection of useful bash and PowerShell (pwsh) scripts.
You will need:
- a PowerShell shell to run the scripts under
pwsh
directory. - a bash shell to run the scripts under the
bash
directory.
Windows:
- Install PowerShell on Windows if necessary.
- Install WSL2 to run bash commands in Windows.
Linux:
MacOS:
PowerShell:
- Load pwsh modules:
Import-Module ./pwsh/HelloWorld.psm1 -DisableNameChecking
- Use pwsh functions, for example:
Print-HelloWorld
- List modules with
Get-Module
- Get help for a module with
Get-Help [module-name]
, e.g.Get-Help HelloWorld
- Run pester unit tests with
Invoke-Pester
. This looks for tests recursively in the current working directory and its nested subdirectories. - Create a function in your powershell profile for quick global access:
Then run with
function Test-Module { Invoke-Pester -Path "scripts\pwsh\Tests" } Set-Alias -Name "test" -Value "Test-Module" -Scope Global Set-Alias -Name "t" -Value "Test-Module" -Scope Global
t
ortest
from anywhere.
Bash:
- Use bash scripts, for example:
./bash/delete-workflow-runs.sh "kgapos/scripts"
This project is licensed under the MIT License, see the LICENSE file for details.
These scripts are implemented in Windows and tested in WSL2 and Linux (Ubuntu 22.04). They should also work on macOS but are not tested there. Please raise issues if you find any.