Exercises
- On attempting to run a script we’ve written, another user on our machine gets an error message that says
running scripts is disabled on this system
. What do we have to do to allow them to run the script? - We have a young relative who loves Dungeons and Dragons, but they’ve lost their 20-sided die. We write a short PowerShell script for them,
Get-Die.ps1
, as follows:Get-Random -Minimum 1 -Maximum 20
This will produce a random number between 1 and 20 every time it is run. Which value in this line of code is most likely to change if they lose another die with a different number of sides?
- In the
Get-Die.ps1
script from the previous question, how would we parameterize the changing value? - What type of parameter should it be, and how would we specify it?
- They like the script, and now they’ve lost their four-sided die. They’ve discovered that they can put any number they like into the parameter. While this was quite cool at first, now...