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.
A. Convert-Path
B. Start-Transcript
C. New-WinEvent
D. Wait-Process
A. Add-PswaAuthorizationRule
B. Configure-PswaAuthorizationRule
C. Test-PswaAuthorizationRule
D. Install-PswaWebApplication
A. Script Modules
B. Binary Modules
C. Manifest Modules
D. Dynamic Modules
A. Export-Alias
B. Export-Csv
C. Export-PSSession
D. Export-Excel
A. CTRL + S
B. CTRL + P
C. CTRL + J
D. CTRL + K
E. CTRL + T
A. F1
B. F2
C. F3
D. F4
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
A. CTRL + SHIFT + C
B. CTRL + SHIFT + S
C. CTRL + SHIFT + D
D. ALT + SHIFT + T
A. Microsoft.PowerShell.Archive
B. Integrated Scripting Environment (ISE)
C. Microsoft.PowerShell.Diagnostics
D. PSScheduledJob
A. -Mta
B. -ExecutionPolicy
C. -Profile
D. -Sta
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.
A. Get_Pswa_AuthorizationRule
B. Get-Pswa-AuthorizationRule
C. Get-PswaAuthorizationRule
D. Get_Psw_AuthorizationRule
A. File
B. EncodedPolicy
C. Mta
D. PSConsoleFile
A. -Id
B. -InstanceId
C. -Confirm
D. -WhatIf
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.
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
A. DCOM
B. Netflix
C. UDP
D. WSMan
A. $psISE
B. UIWindow
C. TIter
D. TBuffer
Choose True or False.
We can integrate PowerShell runtime into .NET applications.
A.
True
B.
False
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.Â
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.
A. Add()
B. Remove()
C. SetSelectedPowerShellTab()
D. Rename()
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
A. Stop-PSSession
B. End-PSSession
C. Exit-PSSession
D. None of the above
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.
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
A. Start-Process
B. Start-Job
C. Start-Service
D. Set-Item
A. ALT + SHIFT + P
B. CTRL + SHIFT + P
C. CTRL + SHIFT + N
D. CTRL + SHIFT + C
A. 50
B. 100
C. 300
D. 400
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.
A. CTRL + R
B. ALT + SHIFT + R
C. CTRL + 1
D. CTRL + 3
A. F6
B. F7
C. F8
D. F9
A. Invoke-WSManAction
B. Set-WSManInstance
C. Set-WSManQuickConfig
D. Enable-WSManCredSSP
A. -Name
B. -Member
C. -SID
D. -Group
A. Clear()
B. LineCount()
C. Focus()
D. ToggleOutliningExpansion()
A. FAN-IN configuration
B. FAN-OUT configuration
C. Both a and b
D. Neither a nor b
A. .ps1
B. .psm1
C. .psd1
D. .ps1xml
A. Get-Credential
B. Get-AuthenticodeSignature
C. Get-ExecutionPolicy
D. Get-Acl
A. -DisplayError
B. -Property
C. -View
D. -ShowError
A. Only the current scope.
B. Current scope and its child scopes.
C. Globe scope.
D. All of the above.
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.
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.
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.Â
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}
A. V
B. H
C. K
D. ?
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.
A. Shift + F2
B. Shift + F3
C. Alt + F3
D. Ctrl + F6
A. Write-Output
B. Write-Host
C. Write-Progress
D. Write-Verbose
A. Variable breakpoint.
B. Line breakpoint.
C. Command breakpoint.
D. All of the above.
A. Normal
B. Minimized
C. Visible
D. Hidden