GithubHelp home page GithubHelp logo

romero126 / pskoans Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vexx32/pskoans

0.0 1.0 0.0 435 KB

A simple, fun, and interactive way to learn the PowerShell language through Pester unit testing.

License: GNU General Public License v3.0

PowerShell 100.00%

pskoans's Introduction

PowerShell Koans

Current Release Most Recent Build
Build status Build status

Inspired by Chris Marinos's fantastic F# koans, the goal of the PowerShell koans is to teach you PowerShell through Pester unit testing.

When you first run the koans, you'll be presented with a runtime error and a stack trace indicating where the error occured. Your goal is to make the error go away. As you fix each error, you should learn something about the PowerShell language and programming / scripting in general.

Your journey towards PowerShell enlightenment starts in the Foundations/AboutAssertions.Koans.ps1 file. These koans will be very straightforward, so try not to overthink them! As you progress through the koans, more types of PowerShell syntax will be introduced which will allow you to solve more complicated problems and use more advanced techniques.

Table of Contents

Prerequisites

The PowerShell Koans need PowerShell version 5.1 or Core 6+ to be run; make sure that you have a sufficient version installed before starting the project. You will also need the most recent version of Pester installed. To do so, please run:

# PS 5.1 (upgrade to latest Pester)
Install-Module Pester -Force -SkipPublisherCheck -Scope CurrentUser

# PS Core 6.0+ (Install Pester under current user)
Install-Module Pester -Scope CurrentUser

Getting Started

Install from Gallery

  1. Install-Module PSKoans -Scope CurrentUser
  2. Run Measure-Karma to get things started.
  3. Run Measure-Karma -Meditate to open your Koans folder either directly or in VS Code (if installed).

Clone the Repo

  1. git clone the repository into your desired directory, or download the repository as a .zip file and extract into a directory of your choice.
  2. Then from a normal powershell session run Get-ChildItem -Recurse | Unblock-File in that directory to remove the "downloaded from internet" flag that blocks them from running.
  3. Check Get-ExecutionPolicy: if it says 'Restricted' or 'Undefined', you need to also run Set-ExecutionPolicy RemoteSigned in order to allow the scripts to run.
  4. Run Install-Module -Path .\Path\To\PSKoans-master
  5. Before working with the module, run Measure-Karma (rake for short) once to initialise everything, and then run Measure-Karma -Koans (or -Meditate) to open the Koans folder for you to begin your journey.

Contributing

We have a great many topics to cover, including the near-infinite slew of PowerShell cmdlets that all deserve koan coverage.

Naturally, we're happy to accept any and all help that comes our way!

There are two main ways you can contribute:

  1. Feel more than free to clone the repository, make some changes, and submit a pull request!
  2. Submit any small changes you'd like make to any of the koans as an issue on the repository, and either myself or one of the helpers here will be happy to talk it over and get it sorted out.

Writing Koans

If you are writing a koan file, the header of the file must follow this format (comments can be placed around this area if you feel the need to as well.)

#Requires -Modules PSKoans
[Koan(Position = $Index)]
param()

$Index should be an unsigned integer. The index indicates the order in which the koans should be sorted. Try to pick an index that is unused and makes sense. If you think it should go in between two other koan files, make sure to modify other indexes as necessary so that we can properly review the pull request.

The goal of the koans is to help those who have very limited knowledge learn PowerShell. In order to do that, simplicity and accessibility are key. There are some advanced topics out there that deserve coverage, and in order to cover them effectively we need to deal with them as clearly and simply as possible. If you need a hand, don't be afraid to simply submit the pull request before it's ready; we're more than happy to offer our own suggestions and help for your ideas!

If you just want to make a general comment or some recommendations, or if you want to suggest a koan topic to cover, feel free to submit your thoughts as an issue. I try to keep up to speed with those!

pskoans's People

Contributors

friedrichweinmann avatar nqui avatar rdbartram avatar romero126 avatar vexx32 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.