MCQs > IT & Programming > Windows PowerShell MCQs > Basic Windows PowerShell MCQs

Basic Windows PowerShell MCQ

1. In Windows PowerShell, the Export-Counter cmdlet is designed to export which of the following types of data?

Answer

Correct Answer: Both options a and b.

Note: This Question is unanswered, help us to find answer for this one

2. In Windows PowerShell, which of the following statements is/are correct about remoting?

Answer

Correct Answer: Persistent connections can be created using Windows PowerShell.
We can run background jobs remotely.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

3. By default, PowerShell Remoting and WinRM listen on which of the following ports?

Answer

Correct Answer: HTTP: 5985
HTTPS: 5986

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

4.

Which of the following statements are correct about Windows PowerShell?

1. It is not a scripting language.

2. It is a command-line interface designed especially for system administrators.

3. It gives you access to the file system on your computer.

4. It enables you to access system registry but not the digital signature certificate stores.

Answer

Correct Answer:

Only statements 2 and 3 are correct. 


Note: This Question is unanswered, help us to find answer for this one

5. What is the function of the PowerShell cmdlet, Clear-Item?

Answer

Correct Answer: It is used to delete the contents of an item.

Note: This Question is unanswered, help us to find answer for this one

6. Which of the following PowerShell cmdlets can be used to display a single property of an object at a time?

Answer

Correct Answer: Format-Wide

Note: This Question is unanswered, help us to find answer for this one

7. Which of the following PowerShell commands is used to import the commands from a different session and save them in a Windows PowerShell module?

Answer

Correct Answer: Export-PSSession

Note: This Question is unanswered, help us to find answer for this one

8. Choose the keyboard shortcut that can be used to run a selected portion of a script in the Scripts pane of Windows PowerShell ISE.

Answer

Correct Answer: F8

Note: This Question is unanswered, help us to find answer for this one

9.

While importing performance counter data through the Import-Counter cmdlet in Windows PowerShell, which of the following files can be used to import data?

1. comma-separated value (.csv)

2. tab-separated value (.tsv)

3. binary performance log (.blg)

4. text (.txt)


Answer

Correct Answer:

Only options 1, 2 and 3. 


Note: This Question is unanswered, help us to find answer for this one

10. In Windows PowerShell, which of the following options are the correct parameters of Test-ScriptFileInfo cmdlet that can be used to specify a path to one or more locations?

Answer

Correct Answer: LiteralPath
Path

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

11. In Windows PowerShell, which of the following parameters of the Assert-MockCalled cmdlet is mandatory to be used?

Answer

Correct Answer: -ExclusiveFilter

Note: This Question is unanswered, help us to find answer for this one

12.

Choose True or False.

When the Receive-PSSession cmdlet is used to connect to a session where no commands are running/suspended, then no output is returned.


Answer

Correct Answer:

True


Note: This Question is unanswered, help us to find answer for this one

13. While working with scripts in Windows PowerShell ISE, which of the following keyboard shortcuts can be used to stop a running script?

Answer

Correct Answer: CTRL + BREAK
CTRL + C

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

14. In Windows PowerShell, variables are specified with which of the following symbols?

Answer

Correct Answer: $

Note: This Question is unanswered, help us to find answer for this one

15. While working with Windows PowerShell Remoting, which of the following options is the valid cmdlet that is used to start an interactive session with a single remote computer?

Answer

Correct Answer: Enter-PSSession

Note: This Question is unanswered, help us to find answer for this one

16.

In Windows PowerShell, the Debug-Job cmdlet is designed to debug which of the following jobs?

1. Windows PowerShell Workflow jobs.

2. Background jobs.

3. Jobs running in remote sessions.


Answer

Correct Answer:

All options 1, 2 and 3.


Note: This Question is unanswered, help us to find answer for this one

17.

In Windows PowerShell, which of the following statements is/are correct about the Get-IseSnippet cmdlet?

1. It can get the PS1XML files that do not contain reusable text snippets created by a user.

2. It can only work in Windows PowerShell ISE.

3. It can be used to get the built-in snippets.

4. It cannot be used to get the snippets that are imported from the modules through the Import-IseSnippet cmdlet.


Answer

Correct Answer:

Only statements 2 and 4. 


Note: This Question is unanswered, help us to find answer for this one

18. Which of the following commands can be used for configuring a computer for receiving remote commands without asking for user confirmation?

Answer

Correct Answer: PS C:\> Enable-PSRemoting -Force

Note: This Question is unanswered, help us to find answer for this one

19. Which of the following options are the valid profile types that can be created and used in Windows PowerShell ISE?

Answer

Correct Answer: Current user, PowerShell ISE
All users, PowerShell ISE

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

20. In Windows PowerShell, the Set-ExecutionPolicy cmdlet is used to change the default execution policy. If you want to run scripts, the execution policy can be set to which of the following options?

Answer

Correct Answer: RemoteSigned
AllSigned

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

21.

Which of the following statements are correct about Windows PowerShell providers?

1. They are used to manage the properties of items in a data store.

2. They cannot be used to move items in a data store.

3. They can be used to create drives.

4. They cannot be used to remove drives.


Answer

Correct Answer:

Only statements 1 and 3 are correct. 


Note: This Question is unanswered, help us to find answer for this one

22.

Which of the following encoding options are supported by Windows PowerShell ISE?

1. ASCII

2. UTF32

3. UTF7

4. BigEndianUnicode


Answer

Correct Answer:

All options 1, 2, 3 and 4. 


Note: This Question is unanswered, help us to find answer for this one

23. In Windows PowerShell ISE, which of the following keyboard shortcuts is used to maximize the Script pane?

Answer

Correct Answer: CTRL + 3

Note: This Question is unanswered, help us to find answer for this one

24. In Windows PowerShell, the Test-Path cmdlet is used to check the existence of all the elements of a path. Which of the following options is returned if any of the elements is missing?

Answer

Correct Answer: $False

Note: This Question is unanswered, help us to find answer for this one

25. In Windows PowerShell, which of the following options are the optional parameters of the Invoke-History cmdlet? 1. WhatIf 2. Confirm 3. Id

Answer

Correct Answer: All options 1, 2 and 3.

Note: This Question is unanswered, help us to find answer for this one

26. In Windows PowerShell ISE, which of the following objects represents a Windows PowerShell runtime environment?

Answer

Correct Answer: The PowerShellTab

Note: This Question is unanswered, help us to find answer for this one

27. With respect to theNew-PSWorkflowSessioncmdlet in Windows PowerShell ISE, which of the following are the valid values of the -Authenticationparameter?

Answer

Correct Answer: Basic
Kerberos

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

28. With respect to the Test-Connection cmdlet in Windows PowerShell, which of the following are the valid values for the parameter, -WsmanAuthentication?

Answer

Correct Answer: Default
Digest

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

29. 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?

Answer

Correct Answer: Normal
Minimized
Hidden

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Line breakpoint.

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Write-Output

Note: This Question is unanswered, help us to find answer for this one

32. 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?

Answer

Correct Answer: Shift + F3

Note: This Question is unanswered, help us to find answer for this one

33.

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.


Answer

Correct Answer:

Only statements 2 and 3.


Note: This Question is unanswered, help us to find answer for this one

34. 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?

Answer

Correct Answer: V
K

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

35.

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?


Answer

Correct Answer:

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


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


Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

36.

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.

Answer

Correct Answer:

Only statements 1, 3 and 4 are correct.


Note: This Question is unanswered, help us to find answer for this one

37.

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

1. cat

2. mount

3. popd

4. kill


Answer

Correct Answer:

All options 1, 2, 3 and 4.


Note: This Question is unanswered, help us to find answer for this one

38. In Windows PowerShell, the Set-StrictMode cmdlet affects which of the following scopes?

Answer

Correct Answer: Current scope and its child scopes.

Note: This Question is unanswered, help us to find answer for this one

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?

Answer

Correct Answer: -ShowError

Note: This Question is unanswered, help us to find answer for this one

40. 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?

Answer

Correct Answer: Get-Acl

Note: This Question is unanswered, help us to find answer for this one

41. Which of the following file extensions is used to represent a module manifest file?

Answer

Correct Answer: .psd1

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: FAN-OUT configuration

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Clear()
Focus()
ToggleOutliningExpansion()

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: -Member

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Set-WSManQuickConfig

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: F9

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: CTRL + R

Note: This Question is unanswered, help us to find answer for this one

48. Which of the following statements is incorrect about Windows PowerShell workflow?

Answer

Correct Answer: Workflow tasks can never be scheduled.

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: 400

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: CTRL + SHIFT + P

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Start-Job

Note: This Question is unanswered, help us to find answer for this one

52.

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?


Answer

Correct Answer:

1000


Note: This Question is unanswered, help us to find answer for this one

53.

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.


Answer

Correct Answer:

Only statements 1 and 3.


Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Exit-PSSession

Note: This Question is unanswered, help us to find answer for this one

55.

Choose True or False.

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


Answer

Correct Answer:

False


Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Rename()

Note: This Question is unanswered, help us to find answer for this one

57.

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.


Answer

Correct Answer:

All options 1, 2 and 3.  


Note: This Question is unanswered, help us to find answer for this one

58.

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.


Answer

Correct Answer:

Only options 1 and 3. 


Note: This Question is unanswered, help us to find answer for this one

59.

Choose True or False.

We can integrate PowerShell runtime into .NET applications.


Answer

Correct Answer:

True


Note: This Question is unanswered, help us to find answer for this one

60. Which of the following options is the principal root object in Windows PowerShell ISE?

Answer

Correct Answer: $psISE

Note: This Question is unanswered, help us to find answer for this one

61. 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?

Answer

Correct Answer: DCOM
WSMan

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

62.

Choose True or False.

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


Answer

Correct Answer:

True


Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: It is used to run commands on a local computer.
It is used to run commands on a remote computer.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: -Id
-InstanceId

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: File

Note: This Question is unanswered, help us to find answer for this one

66. 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?

Answer

Correct Answer: Get-PswaAuthorizationRule

Note: This Question is unanswered, help us to find answer for this one

67. Which of the following operations cannot be performed by the Enable-PSRemoting cmdlet?

Answer

Correct Answer: It creates a new remote client.

Note: This Question is unanswered, help us to find answer for this one

68. 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?

Answer

Correct Answer: -Mta
-ExecutionPolicy
-Sta

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Microsoft.PowerShell.Diagnostics

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: CTRL + SHIFT + D

Note: This Question is unanswered, help us to find answer for this one

71.

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

"WARNING: Test warning"


Answer

Correct Answer:

Write-Warning

Note: This Question is unanswered, help us to find answer for this one

72. 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?

Answer

Correct Answer: F3

Note: This Question is unanswered, help us to find answer for this one

73. 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?

Answer

Correct Answer: CTRL + J

Note: This Question is unanswered, help us to find answer for this one

74. 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?

Answer

Correct Answer: Export-Csv

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Binary Modules

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Install-PswaWebApplication

Note: This Question is unanswered, help us to find answer for this one

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

Answer

Correct Answer: Convert-Path
Wait-Process

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one