Iron Scripter 2019 Prelude Challenge #2

Iron Scripter 2019 Prelude Challenge #2

To continue preparing you for the upcoming battle, the Chairman has arranged another prelude challenge. If the Chairman is feeling generous, a sample solution may be provided in about a week’s time.

Premise

You have been given a function from a previous co-worker that you need to maintain. The code does not work as expected any more. Correct the function according to your faction’s scripting philosophy and create a Pester test file to unit test the code. You do not necessarily have to re-write the function from scratch. This is the code that needs to be corrected and serve as the basis of your Pester unit test.

Background

This function should get disk information from one or more computers. It should accept computer names via a parameter and from the pipeline and should only get a drive C through G. Errors should be logged to a text file with a file name that includes a timestamp value in the form YearMonthDayHourMinute.

For non-North Americans feel free to adjust the date time format in the function and Pester tests.

Correct output should look like this:

sample correct output

Be sure to verify that the logging errors feature works as expected.

Allez de code!

Jeffery Hicks

3 thoughts on “Iron Scripter 2019 Prelude Challenge #2

ICYMI: PowerShell Week of 1-March-2019 | PowerShell.orgPosted on  4:08 pm - Mar 1, 2019

[…] Iron Scripter 2019 Prelude Challenge #2 […]

IronScripter Prelude Challenge #2 – Josh's BlogPosted on  2:10 pm - Mar 4, 2019

[…] second prelude challenge has been posted, I may be a little behind getting something together, but here it is. Take a look […]

Prelude #2 Solution – Iron ScripterPosted on  3:02 pm - Mar 5, 2019

[…] last Chairmans’s challenge was based on a task you might have to face in real life – fixing someone else’s code. Although, that someone may be you! Of course it helps to know what should happen, which the […]

Leave your message

%d bloggers like this: