stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
IT 426 PowerShell Operators and Wildcards Flashcards | StudBud
Explore
/
IT 426 PowerShell Operators and Wildcards
IT 426 PowerShell Operators and Wildcards
28 terms
·
StudBud Administration
·
867 plays
A programming quiz for reviewing Programming concepts in PowerShell
Flashcards
28 cards
F
Practice quiz
P
Host live
L
Questions
28
Answers
1
Concatenate the strings 'abc' and 'xyz'
abc','xyz'
abc'||'xyz'
'abc'+'xyz'
cat('abc','xyx')
2
Test whether the variable $def contains the string 'hash'. The test should be case sensitive.
$def -case '*hash*'
$def -like '*hash*'
$def -like '%hash%'
$def -clike '*hash*'
3
Divide $a by 4. Store the remainder in $a.
$a %= 4
$a % 4 = $a
$a %% 4
mod($a, 4)
4
Add the numbers 3 and 5
3+5
add(3,5)
3++5
3&5
5
Write an expression testing whether 10 is less than or equal to 20
10 -le 20
lessEqual(10,20)
10 <= 20
10 -lessThanEqual 20
6
Multiply $a by 2. Store the result in $a.
$a *= 2
$a ** 2
prod($a, 2)
$a * 2 = $a
7
Write an expression testing whether $a is equal to 3 AND $b is less than or equal to 5
($a -eq 3) & ($b -le 5)
($a -eq 3) && ($b -le 5)
($a -eq 3) AND ($b -le 5)
($a -eq 3) -and ($b -le 5)
8
Repeat the string 'abc' three times
'abc' | 'abc' | 'abc'
rep('abc',3)
3 x 'abc'
'abc' * 3
9
Divide 8 by 3 and return the remainder
8 -mod 3
rem(8/3)
mod(8,3)
8%3
10
Divide 9 by 3
9/3
9//3
div(9,3)
9 -div 3
11
Increment $a by 1
inc($a)
$a = $a+
$a = $a + $a
$a++
12
Test whether $a equal 2 or $b equals 8. Only one of these two statements may be true.
($a -eq 2) XOR ($b -eq 8)
($a -eq 2) <>OR ($b -eq 8)
($a -eq 2) -xor ($b -eq 8)
($a -eq 2) <-> ($b -eq 8)
13
Subtract 6 from 7
3--6
3_6
sub(7,6)
7-6
14
Assign the value of 8 to $a
$a = 8
$a <- 8
8 = $a
$a < 8
15
Write an expression testing whether 7 is greater than 6
7 > 6
9 -more 6
7 -gt 6
isGreater(7,6)
16
Write an expression testing whether 'abc' equals 'def'
compareString('abc','def')
'abc' -eq 'def'
abc' = 'def'
'abc' == 'def'
17
Write an expression testing whether $num is NOT equal to 8.
$num != 8
!($num = 8)
$num <> 8
$num -ne 8
18
Divide $a by 3. Store the result in $a.
$a / 2 = $a
$a // 2
quot($a, 2)
$a /= 3
19
Write an expression testing whether 3 and 6 are equal
3 == 6
equal(3,6)
3 -eq 6
3 = 6
20
Write an expression testing whether $a contains the string 'windows' OR $b is less than 9
($a -like '*windows*') OR ($b -lt 9)
($a -like '*windows*') || ($b -lt 9)
($a -like '*windows*') ^ ($b -lt 9)
($a -like '*windows*') -or ($b -lt 9)
21
Multiply 8 and 6
8**6
8*6
prod(8,6)
8x6
22
$abc contains 'hash tables'. Display the contents of $abc replacing 'tables' with 'browns'
$abc -replace 'tables', 'browns'
$abc -rep 'tables', 'browns'
$abc | 'tables', 'browns'
$abc >> $abc - 'tables' + 'browns'
23
Decrement $a by 1
$a = $a-
dec($a)
$a--
$a = $a - $a
24
Write an expression testing whether the variable $abc contains the string 'love'
$abc -like '*love*'
'*love*' -like $abc
'love' -like $abc
$abc -like 'love'
25
Add 3 to the value of $a. Store the result in $a.
$a += 3
$a ++ 3
sum($a, 3)
$a + 3 = $a
26
Subtract 5 from $a. Store the result in $a
$a -- 5
diff($a, 5)
$a - 5 = $a
$a -= 5
27
Write an expression testing whether the variable $name is equal to 'Sale'
$name -is 'Sale'
$name = 'Sale'
$name -eq 'Sale'
$name == 'Sale'
28
Write an expression testing whether 9 is less than 8
8 < 9
less(9,8)
9 < 8
9 -lt 8