Exercises
- What does AHA stand for?
- Why should we be very careful when using dot sourcing?
- We’ve created a variable called
$ScriptBlock
and populated it with a scriptblock. Let’s say we call it like this:$ScriptBlock
We don’t get the output we expect. Why not?
- What parameter argument might we use to check that our input is a valid IP address?
- We’ve created a filter,
get-square
, and we’re trying to use it like this:Get-square 365
Why isn’t there any output?
- What are we doing here?
$private:number
- What’s the main difference between a function and a scriptblock?
- What are we doing wrong here?
Function get-square($a) {$a*$a} 15 | get-square
- We’ve spent a lot of time in this chapter getting an inaccurate square root. How would we write a function to get an accurate square root?
Function get-root($a) { <what goes here?> }