D&D inspired Powershell helper to register defined commands as simple functions with parameter completers. Every Wizard should have one.
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
This project was intended to boost Powershell productivity by making day to day tasks faster and easier. The basic idea is define Powershell commands with its parameter and default value definitions in a file, and make a process register function aliases over them with parameter completers. This makes the command call crazy easy with Tab autocomplete magic.
This idea comes specially useful with Docker containers, avoiding to install nothing but Docker, and run complex commands without extra prerequisites. Some extra features where added after, like extended history, index, and command help.
Powershell execution policy must allow script execution.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Spell definitions are YAML based, but Powershell does not have a built in ConvertFrom-Yaml. Installing this module makes the trick for now.
Install-Module powershell-yaml
-
Clone the repo.
git clone https://github.com/Ark667/Spellbook.git
-
Execute Spellbook register.
.\Spellbook\src\Spellbook.ps1
-
Execute index command, just type "Spell" and Tab through options.
Spellbook-Index
Configure in $profile the invocation of this script The global commands you can search for spells, view its documentation or update the current definitions.
The index shows available spells registered. Filter argument apply over result on Tags and School.
Spellbook-Index [filter]
Help shows command documentation.
Spellbook-Help [spell]
History shows commands execution log with its full info.
Spellbook-History
Update registers the current definitions.
Spellbook-Update
Now you can execute some spells.
This example execute de AWS Cli through official Docker container. This spell (Aws-Cli) also has an alias to make it work like AWS Cli where installed in your machine.
aws
This simple spell will create a MySql container with mapped volume, exposed port and default root password, everything displayed on output.
Create-MySql
Just enjoy!
Spellbook load can be added on Powershell terminal startup adding a call to Spellbook.ps1 on profile file. Just edit the file with this call.
notepad.exe $profile
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Show me your spells!
Distributed under the MIT License. See LICENSE.txt
for more information.
Aingeru Medrano - @AingeruBlack
Project Link: https://github.com/Ark667/Spellbook