Cmdlets MCQ Questions & Answers
Cmdlets MCQs : This section focuses on "Cmdlets" in Powershell. These Multiple Choice Questions (MCQ) should be practiced to improve the Powershell skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.
1. cmdlet stands for?
A. Command let
B. Command lightweight
C. Comman let
D. Command let
View Answer
Ans : D
Explanation: A cmdlet or "Command let" is a lightweight command used in the Windows PowerShell environment.
2. Cmdlets are .NET Framework class objects
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: Cmdlets are .NET Framework class objects; and not just stand-alone executables
3. Which of the following is true about Cmdlet?
A. Cmdlets are record-based as they process a single object at a time
B. Cmdlets process works on objects not on text stream and objects can be passed as output for pipelining.
C. Parsing, error presentation, and output formatting are not handled by cmdlets. It is done by the Windows PowerShell runtime.
D. All of the above
View Answer
Ans : D
Explanation: All of the above is true about Cmdlet.
4. Cmdlets can have?
A. required parameters
B. switch parameters
C. positional parameters
D. All of the above
View Answer
Ans : D
Explanation: Cmdlets can have required, named, positional, and switch parameters. Switch parameters allow you to define parameters that are evaluated only if the parameters are specified in the call.
5. Most cmdlets are based on ___________ classes.
A. PHP
B. SQL
C. .NET
D. Java
View Answer
Ans : C
Explanation: Most cmdlets are based on .NET classes that derive from the System.Management.Automation.Cmdlet base class.
6. PowerShell uses a _______ name pair to name cmdlets.
A. verb
B. noun
C. Both A and B
D. None of the above
View Answer
Ans : C
Explanation: PowerShell uses a verb-and-noun name pair to name cmdlets. For example, the Get-Command cmdlet included in PowerShell is used to get all the cmdlets that are registered in the command shell.
7. cmdlets can receive _________ as input and deliver ________ as output
A. classes, objects
B. objects, classes
C. classes, classes
D. objects, objects
View Answer
Ans : D
Explanation: cmdlets can receive objects as input and deliver objects as output, which can then feed the input of subsequent objects, enabling cmdlets to form a command pipeline.
8. ____________ are specialized arguments that offer preset options or selections.
A. Arguments
B. Switches
C. Parameters
D. None of the above
View Answer
Ans : B
Explanation: Switches are specialized arguments that offer preset options or selections.
9. Although PowerShell relies on processing cmdlets, there is a second type of command called?
A. function
B. declare
C. classes
D. define
View Answer
Ans : A
Explanation: Although PowerShell relies on processing cmdlets, there is a second type of command called functions. Functions are also interpreted through PowerShell and are routinely used in scripts. It's common to confuse cmdlets and functions. However, cmdlets and functions differ in several important ways.
10. Cmdlets can be easily constructed from as few as a dozen lines of code
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Cmdlets can be easily constructed from as few as a dozen lines of code
Discussion