PowerShell Quiz 2

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

10 Terms

1
New cards

By default, the type of $n will be ___________.

$n = 123

Int32

2
New cards

Newbie Admin wants to store the value 0 in a variable.  Which of the following statements would correctly solve the problem? (Select ALL correct answers)

  • A. tot = 0

  • B. $tot

  • C. $tot = 0

  • D. $n = 0

C & D

3
New cards

In PowerShell, what would be printed by the code below?

$num = 1

$num = 2.8

$fnum = [Int32]$num

$fnum

3

4
New cards

What are the basic data types?

boolean, string, integer and floating point

5
New cards

PowerShell uses Double by default for numbers with a decimal point.

True

6
New cards

What would be printed by the following code?

$Num = 80

$str = 'The Result is $Num'

$str

The Result is $Num

7
New cards

Newbie Admin is writing a PowerShell script and needs to determine the number of characters stored in the string variable $str.  Which of the following would be a correct way to count the characters and store the result in the variable $num?

$num = $str.length

8
New cards

In the statements below,  remove is  a ________________

$Str = "A rolling stone gathers no moss."

$Str2 = $Str.remove(4,3)

method

9
New cards

What would be printed by the following code?

$Num = 80

$str = "The Result is $Num"

$str

The Result is 80

10
New cards

In the following scenario, what is stored in $Str2?

$Str = "A rolling stone gathers no moss."

$Str2 = $Str.remove(4,3)

A rong stone gathers no moss.