Skip to content

kgapos/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Scripts

Scripts logo

Introduction

A collection of useful bash and PowerShell (pwsh) scripts.

Table of Contents

Getting Started

Prerequisites

You will need:

  • a PowerShell shell to run the scripts under pwsh directory.
  • a bash shell to run the scripts under the bash directory.

Installation

Windows:

Linux:

MacOS:

Usage

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:
    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
    Then run with t or test from anywhere.

Bash:

  • Use bash scripts, for example:
    ./bash/delete-workflow-runs.sh "kgapos/scripts"

License

This project is licensed under the MIT License, see the LICENSE file for details.

Disclaimer

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.

About

A collection of useful scripts

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published