This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Select the best response for each question.
Which file extension is correct for a script?
.pm1
.ps
.ps1
What's the correct way to declare a required parameter?
Add this decorator: [Required].
[Required]
Add this decorator: [Parameter(Mandatory)].
[Parameter(Mandatory)]
You can't. You need to verify that parameter values are set.
How can you cause a terminating error?
Use the keyword Throw followed by a string or object.
Throw
Create a new instance of the class Error, like this: new Error("error message")
Error
new Error("error message")
Use the common parameter ErrorAction, like this: -ErrorAction Error
ErrorAction
-ErrorAction Error
You must answer all questions before checking your work.
Was this page helpful?