Question: Evaluate the PowerShell syntax below: [ CmdletBinding ( ) ] param ( [ Parameter ( Mandatory = $True ) ] [ String ] $ComputerName ,
Evaluate the PowerShell syntax below:
CmdletBinding
param
Parameter Mandatory$True
String $ComputerName
Int $DriveType
Which of the following statements is correct regarding the above PowerShell syntax?
Group of answer choices
Both the $ComputerName and the $DriveType parameters are mandatory, therefore a user will be prompted to enter values for both parameters if the user does not provide values for both parameters in the syntax to run the script.
Only the $ComputerName parameter is mandatory, therefore a user will only be prompted to enter a value for the $ComputerName parameter if the user does not provide a value in the syntax to run the script. The default value of will be used for the $DriveType parameter if the user does not provide a value in the syntax to run the script.
Only the $DriveType parameter is mandatory, therefore a user will only be prompted to enter a value for the $ DriveType parameter if the user does not provide a value in the syntax to run the script. The default value of LocalHost will be used for the $ComputerName parameter if the user does not provide a value in the syntax to run the script.
Only the $ComputerName parameter is mandatory, therefore a user will only be prompted to enter a value for the $ComputerName parameter if the user does not provide a value in the syntax to run the script. Since the $DriveType parameter is not mandatory, the script will ignore the $DriveType parameter and the script will run without using the $DriveType parameter in any of the Cmdlets within the script.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
