Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 3.06 KB

File metadata and controls

35 lines (22 loc) · 3.06 KB

Friday PowerShell Puzzle: Write a map method for PowerShell

We have a really fun puzzle for this week. I've been taking a Coursera class on mapping geospatial data. One of the Java libraries that we're using has a neat map() method that maps a value from one range to another.

For this week's puzzle, we'll write ConvertTo-Range, a map() function for PowerShell. But, instead of providing instructions, I've written a file of Pester tests, ConvertTo-Range.Tests.ps1, and a ConvertTo-Range.ps1 with comment-based help.

If you run the test file now, all the tests fail. Your mission is to write a ConvertTo-Range function that makes all of the tests pass. You get to dust off your math skills and try your hand at test-driven development with Pester.

Files:

Resources:

Thanks to Andy Cahn at Chrysalis School for help with the math!


Like this PowerShell puzzle?

This repository includes all of the SAPIEN Technologies Friday PowerShell puzzles.

To read the solutions to our Friday PowerShell Puzzles, see Friday Puzzle Solutions.