Windows PowerShell MCQs

Windows PowerShell MCQs

The following Windows PowerShell MCQs have been compiled by our experts through research, in order to test your knowledge of the subject of Windows PowerShell. We encourage you to answer these 70+ multiple-choice questions to assess your proficiency.
Please continue by scrolling down.

1: Which of the following options are cmdlets that are contained in the Windows PowerShell Microsoft.PowerShell.Management module for managing Windows?

A.   Convert-Path

B.   Start-Transcript

C.   New-WinEvent

D.   Wait-Process

2: Which of the following cmdlets can be used to configure the Windows PowerShell Web Access web application in IIS?

A.   Add-PswaAuthorizationRule

B.   Configure-PswaAuthorizationRule

C.   Test-PswaAuthorizationRule

D.   Install-PswaWebApplication

3: Which one of the following modules is a .NET framework assembly that contains a compiled code, e.g. C# code?

A.   Script Modules

B.   Binary Modules

C.   Manifest Modules

D.   Dynamic Modules

4: If you want to use Microsoft Excel for manipulating/viewing the output of a command, then which of the following PowerShell cmdlets should be used?

A.   Export-Alias

B.   Export-Csv

C.   Export-PSSession

D.   Export-Excel

5: While working with scripts in Windows PowerShell ISE, which of the following keyboard shortcuts can be used to show snippets in the Script and Command panes?

A.   CTRL + S

B.   CTRL + P

C.   CTRL + J

D.   CTRL + K

E.   CTRL + T

6: Suppose that you are working with the Script pane in Windows PowerShell ISE. You are searching a particular text that has multiple occurrences in the script. Which of the following keyboard shortcuts is used to find the next occurrence of that text in the script?

A.   F1

B.   F2

C.   F3

D.   F4

7:

Which of the given options is the correct format of the cmdlet that will display the following message?

"WARNING: Test warning"


A.  

Write-Warning #Test warning#

B.  

Write-Warning 'Test warning'

C.  

Write-Warning `Test warning` 

D.  

Write-Warning

8: Which of the following keyboard shortcuts is used to display call stack while debugging a script in the Script pane?

A.   CTRL + SHIFT + C

B.   CTRL + SHIFT + S

C.   CTRL + SHIFT + D

D.   ALT + SHIFT + T

9: Which of the following PowerShell modules contains cmdlets that are used to manage data from performance counters and event logs?

A.   Microsoft.PowerShell.Archive

B.   Integrated Scripting Environment (ISE)

C.   Microsoft.PowerShell.Diagnostics

D.   PSScheduledJob

10: The PowerShell.exe command can be used to start a Windows PowerShell session. Which of the following options are the valid parameters of this command?

A.   -Mta

B.   -ExecutionPolicy

C.   -Profile

D.   -Sta

11: Which of the following operations cannot be performed by the Enable-PSRemoting cmdlet?

A.   It starts the WinRM service.

B.   It enables a firewall exception for WS-Management communications.

C.   It creates a new remote client.

D.   It registers the Microsoft.PowerShell32 session configuration on 64-bit computers, when not registered already.

12: With respect to Windows PowerShell Web Access cmdlets, which of the following options is the correct cmdlet that can be used to return a set of Windows PowerShell Web Access Authorization rules?

A.   Get_Pswa_AuthorizationRule

B.   Get-Pswa-AuthorizationRule

C.   Get-PswaAuthorizationRule

D.   Get_Psw_AuthorizationRule

13: With respect to the PowerShell.exe command, which of the following parameters is used to run a specified script in the local scope?

A.   File

B.   EncodedPolicy

C.   Mta

D.   PSConsoleFile

14: In Windows PowerShell, which of the following options are the mandatory parameters of the Debug-Job cmdlet?

A.   -Id

B.   -InstanceId

C.   -Confirm

D.   -WhatIf

15: What is/are the function(s) of the Invoke-Command cmdlet while working with Windows PowerShell?

A.   It is used to run commands on a local computer.

B.   It is used to run commands on a remote computer.

C.   It is used to run commands from the session history.

D.   It is used to call the Windows Management Instrumentation (WMI) methods.

16:

Choose True or False.

In relation to the Windows PowerShell ISE object model hierarchy, the $psISE object is the root object.


A.  

True

B.  

False

17: In Windows PowerShell, while working with the Test-Connection cmdlet, which of the following options are the valid values that can be used for the "Protocol" parameter?

A.   DCOM

B.   Netflix

C.   UDP

D.   WSMan

18: Which of the following options is the principal root object in Windows PowerShell ISE?

A.   $psISE

B.   UIWindow

C.   TIter

D.   TBuffer

19:

Choose True or False.

We can integrate PowerShell runtime into .NET applications.


A.  

True

B.  

False

20:

Which of the following tasks can be performed while enhancing the functionality of Windows PowerShell ISE?

1. We can add and modify the instance of Windows PowerShell ISE.

2. We can manipulate text buffers for the Command pane but not for the Output pane and Script pane.

3. We can perform file operations; for example, we can determine whether or not a file has been changed, after it was last saved.


A.  

All options 1, 2 and 3.

B.  

Only options 1 and 2. 

C.  

Only options 2 and 3.

D.  

Only options 1 and 3. 

21:

Which of the following statements are correct about the Restart-Computer cmdlet in Windows PowerShell?

1. Parameters of the Restart-Computer cmdlet can be used to run the restart operations as a background job.

2. Parameters of the Restart-Computer cmdlet can be used to specify the authentication levels and alternate credentials.

3. Parameters of the Restart-Computer cmdlet can be used to limit the operations that run at the same time.


A.  

All options 1, 2 and 3.  

B.  

Only options 1 and 2.

C.  

Only options 1 and 3.

D.  

Only options 2 and 3.

22: With respect to the PowerShellTabCollection object in Windows PowerShell, which of the following options is NOT a valid method?

A.   Add()

B.   Remove()

C.   SetSelectedPowerShellTab()

D.   Rename()

23:

Choose True or False.

In Windows PowerShell, the Get-DscResource cmdlet cannot be used to discover the resources that are installed in the PSModulePath?


A.  

True

B.  

False

24: Which of the following Windows PowerShell commands is used to end an interactive session with a remote computer?

A.   Stop-PSSession

B.   End-PSSession

C.   Exit-PSSession

D.   None of the above

25:

Which of the following statements is/are INCORRECT about the Suspend-Workflow activity in Windows PowerShell?

1. It stops the workflow permanently.

2. It stops the workflow temporarily.

3. If you do not run the workflow as job, a job object is not returned.


A.  

Only statement 1.

B.  

Only statement 2.

C.  

Only statements 1 and 3.

D.  

Only statements 2 and 3.

26:

In relation to the New-PSWorkflowExecutionOption cmdlet in Windows PowerShell ISE, the -MaxDisconnectedSessions parameter is used to specify the maximum number of disconnected remote sessions.

What is the default value of this parameter?


A.  

500

B.  

1000

C.  

2000

D.  

4000

27: Which of the following commands can be used to start a Windows PowerShell background job on a local computer?

A.   Start-Process

B.   Start-Job

C.   Start-Service

D.   Set-Item

28: While working with Windows PowerShell ISE, which of the following keyboard shortcuts is used to start the Windows PowerShell console (PowerShell.exe)?

A.   ALT + SHIFT + P

B.   CTRL + SHIFT + P

C.   CTRL + SHIFT + N

D.   CTRL + SHIFT + C

29: In Windows PowerShell ISE, what is the maximum value of the Zoom property of the ISEOptions object?

A.   50

B.   100

C.   300

D.   400

30: Which of the following statements is incorrect about Windows PowerShell workflow?

A.   We can assign workflow tasks to hundreds of managed nodes at a time.

B.   We can combine related commands and scripts into a single workflow.

C.   Workflow tasks can never be scheduled.

D.   None of the above is incorrect.

31: In Windows PowerShell ISE, which of the following keyboard shortcuts is used to show/hide the Script pane while customizing a view?

A.   CTRL + R

B.   ALT + SHIFT + R

C.   CTRL + 1

D.   CTRL + 3

32: While debugging scripts in Windows PowerShell ISE, which of the following functional keys can be used to set a line breakpoint?

A.   F6

B.   F7

C.   F8

D.   F9

33: Which of the following cmdlets, contained in the Windows PowerShell Microsoft.WSMan.Management module, is used to configure a local computer for remote management?

A.   Invoke-WSManAction

B.   Set-WSManInstance

C.   Set-WSManQuickConfig

D.   Enable-WSManCredSSP

34: With respect to the Get-LocalGroupMember cmdlet in Windows PowerShell, which of the following parameters is optional?

A.   -Name

B.   -Member

C.   -SID

D.   -Group

35: In relation to Windows PowerShell ISE, which of the following options are the valid methods of the ISEEditor object?

A.   Clear()

B.   LineCount()

C.   Focus()

D.   ToggleOutliningExpansion()

36: Windows PowerShell uses the Web Services for WS-Management protocol and the WinRM service for which of the following types of configuration?

A.   FAN-IN configuration

B.   FAN-OUT configuration

C.   Both a and b

D.   Neither a nor b

37: Which of the following file extensions is used to represent a module manifest file?

A.   .ps1

B.   .psm1

C.   .psd1

D.   .ps1xml

38: Which of the following cmdlets of the Windows PowerShell Microsoft.PowerShell.Security module can be used to get the security descriptor for a resource, such as a file or registry key?

A.   Get-Credential

B.   Get-AuthenticodeSignature

C.   Get-ExecutionPolicy

D.   Get-Acl

39: While formatting the output of a command in PowerShell, which of the following parameters of the Format-List cmdlet is used to send errors through the pipeline?

A.   -DisplayError

B.   -Property

C.   -View

D.   -ShowError

40: In Windows PowerShell, the Set-StrictMode cmdlet affects which of the following scopes?

A.   Only the current scope.

B.   Current scope and its child scopes.

C.   Globe scope.

D.   All of the above.

41:

Which of the following statements is/are correct?

1. We can create an XAML Workflow using Windows PowerShell activities.

2. We can create a Workflow using a Windows PowerShell script.


A.  

Only statement 1 is correct.

B.  

Only statement 2 is correct.

C.  

Both statements 1 and 2 are correct. 

D.  

Both statements 1 and 2 are incorrect.

42:

Which of the following UNIX commands can be used inside Windows PowerShell?

1. cat

2. mount

3. popd

4. kill


A.  

All options 1, 2, 3 and 4.

B.  

Only options 1 and 2.

C.  

Only options 1, 2 and 4.

D.  

Only options 1, 2 and 3.

43:

Which of the following statements are correct about Windows PowerShell and DOS?

1. Windows PowerShell can use pipes to pass the output of one cmdlet to the input for another cmdlet.

2. We can access and manage a system

3. In PowerShell, output of cmdlets is a collection of objects.

4. Windows PowerShell is a fully developed scripting language.

A.  

Only statements 3 and 4 are correct.

B.  

Only statements 1, 2 and 3 are correct.

C.  

Only statements 2, 3 and 4 are correct. 

D.  

Only statements 1, 3 and 4 are correct.

E.  

All statements 1, 2, 3 and 4 are correct. 

44:

Suppose that you want to search the cmdlets that do not have the Session parameter but have the ComputerName parameter, and support remoting without special configuration.

Which of the following options is the correct format of the command that can be used to find these cmdlets?


A.  

Get-Command where { $_.parameters.keys contains}

B.  

Get-Command | where { $_.parameters.keys -contains}

C.  

Get-Command | where { $_.parameters.keys -contains}

D.  

Get-Command where { $.parameters.keys contains}

45: Suppose that you are working in the Console pane while debugging scripts in Windows PowerShell ISE. Which of the following keyboard shortcuts, designed for Windows PowerShell console, should you use to display the console debugging commands?

A.   V

B.   H

C.   K

D.   ?

46:

In Windows PowerShell, which of the following statements are INCORRECT about the Connect-PSSession cmdlet?

1. It can be used to re-connect to the Windows PowerShell sessions that are managed by a user.

2. It can be used to connect to broken or closed sessions.

3. It can be used to connect sessions to sessions started by other users without providing the credentials of the user who created the session.


A.  

All statements 1, 2 and 3. 

B.  

Only statements 1 and 2.

C.  

Only statements 1 and 3.

D.  

Only statements 2 and 3.

47: Suppose that you are working with the Script pane in Windows PowerShell ISE. You are searching a particular text that has multiple occurrences in the script. Which of the following keyboard shortcuts is used to find the previous occurrence of that text in the script?

A.   Shift + F2

B.   Shift + F3

C.   Alt + F3

D.   Ctrl + F6

48: In Windows PowerShell, which of the following cmdlets is used to send specified objects to the next command in the pipeline?

A.   Write-Output

B.   Write-Host

C.   Write-Progress

D.   Write-Verbose

49: In the Windows PowerShell ISE debugging environment, which of the following breakpoints can be set by using the menu or keyboard shortcuts?

A.   Variable breakpoint.

B.   Line breakpoint.

C.   Command breakpoint.

D.   All of the above.

50: Suppose that you are an administrator and you start a Windows PowerShell session from the command line of another tool such as cmd.exe. If you use a -WindowStyle parameter to set the style for the session, then which of the following are the valid values that can be used?

A.   Normal

B.   Minimized

C.   Visible

D.   Hidden