Skip to content

Latest commit

 

History

History
169 lines (124 loc) · 4.2 KB

README.md

File metadata and controls

169 lines (124 loc) · 4.2 KB

Pwsh-Fun (or the Functions I Use)

http://creativecommons.org/licenses/by/4.0/

This work is licensed under a Creative Commons Attribution 4.0 International License

Because PowerShell can be fun (at least that's what I tell myself). Here are some utility functions that can help you to use the Power of your Shell (I can't believe I seriously wrote that).

Installation

To use the modules from Pwsh-Fun you need to include the code from this repository in your PowerShell Modules (or simply Modules) path.

Let's first start by cloning the repository into an empty directory using your favorite cloning method. I'd recommend using GitHub CLI:

gh repo clone r8vnhill/pwsh-fun

Now, with the repository cloned, we'll move the contents from the repo to the Modules path, in PowerShell:

$PS_PROFILE_DIRECTORY = $(Get-Item $PROFILE).Directory.FullName
if (-not $(Test-Path $PS_PROFILE_DIRECTORY\Modules)) {
  New-Item -ItemType Directory -Force -Path $PS_PROFILE_DIRECTORY\Modules
}
Get-ChildItem -Path .\pwsh-fun\* -Recurse -Force `
  | Move-Item -Destination "$PS_PROFILE_DIRECTORY\Modules\"
Remove-Item -Path .\pwsh-fun -Force -Recurse

This will make the modules accessible to PowerShell, you must start a new console to see the changes.

Updating the Modules

Since we copied all the repository's contents in the previous step, the Modules directory is now the root of the repository. The repo is configured to only track the directories which name starts with Ravenhill., so every change you do on other files or directories will be ignored by Git, this will allow you to update the modules easily by simply doing git pull on the Modules root.

Modules Documentation

This repository is organized as multiple directories (Modules) grouping the commands according to their functionality. Each module has it's own README.md file explaining the contained commands.