PowerShell Operators MCQ Questions & Answers
PowerShell Operators MCQs : This section focuses on "Operators" 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. The _____________ are used in a PowerShell to perform the calculation of the numeric values.
A. Assignment Operators
B. Arithmetic Operators
C. Comparison Operators
D. Logical Operators
View Answer
Ans : B
Explanation: The arithmetic operators are used in a PowerShell to perform the calculation of the numeric values. By using these operators, we can add (+), subtract (-), multiply (*), or divide (/) the values.
2. Which operators are used in PowerShell to compare the values.
A. assignment operators
B. logical operators
C. redirection operators
D. comparison operators
View Answer
Ans : D
Explanation: The comparison operators are used in PowerShell to compare the values. For example, we can compare the string of two values to check that they are equal or not.
3. Which operator is an arithmetic operator which is used to calculate the remainder of the division operation.
A. division
B. shell
C. modulus
D. None of the above
View Answer
Ans : C
Explanation: The modulus operator is an arithmetic operator which is used to calculate the remainder of the division operation
4. The syntax which describe how to use the assignment operators?
A. <assignment-operator> <value>
B. <assignable-expression> <assignment-operator>
C. <assignable-expression> <value>
D. <assignable-expression> <assignment-operator> <value>
View Answer
Ans : D
Explanation: The following statement is the syntax which describe how to use the assignment operators: <assignable-expression> <assignment-operator> <value>
5. By default, all comparison operators are?
A. case-insensitive
B. case-sensitive
C. Both A and B
D. None of the above
View Answer
Ans : B
Explanation: By default, all comparison operators are case-sensitive. These operators help us to find, test, compare, modify, and replace the data and information.
6. The ____________ are those operators, which check the equality of two values and also check that one value is greater or less than other value.
A. matching operators
B. containment operators
C. replacement operator
D. equality operators
View Answer
Ans : D
Explanation: The equality operators are those operators, which check the equality of two values and also check that one value is greater or less than other value.
7. The ________ operator returns the Boolean value TRUE if the strings are matched using the wildcard characters.
A. notlike
B. match
C. like
D. notmatch
View Answer
Ans : C
Explanation: The -like operator returns the Boolean value TRUE if the strings are matched using the wildcard characters.
8. TheĀ splitĀ operator is used to split a string into substrings.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, The split operator is used to split a string into substrings.
9. In PowerShell, the addition and multiplication operator may also be used with the strings, hash tables, and arrays.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, In PowerShell, the addition and multiplication operator may also be used with the strings, hash tables, and arrays.
Discussion