MS VA PowerShell Scripting answers

Not sure why I got this wrong when there was heavy emphasis on DOT sourcing.

  1. You added a function called Get-DiskInfo to your script called DiskUtilities.ps1. What steps must take place in order to test your function outside of the PowerShell ISE? (Choose 2)

A. Execute the DiskUtilities.ps1 script
B. Execute the DiskUtilities.ps1 script in DOT Source mode
C. Call the Get-Diskinfo
D. Load your script as a module

I chose B and C. both wrong

Hopefully someone will jump in who knows the specifics here - regrettably, we’re not really a official support channel for the MVAs. Jason will have gotten this so we’ll see if he can maybe chime in - he may have an idea what you’re after. But I’m not sure he actually wrote or has even seen the quiz questions.

Offhand, just reading this out of context, I’d agree with your B&C answer, although “DOT Source mode” is certainly not a way I’ve ever heard dot-sourcing referred to! Makes me curious who DID write the quiz questions.

They may have been going for B and D, which are essentially the same thing (and both will load your function into memory where it can be tested.)

A and C. I believe the question is focusing on the minimum requirements.

In my own experience though, if I were in the process of “testing” it’d be copy and paste into the shell:-)

edit: Wait… C is wrong? The question says ‘must’