WorksheetsPOP_chapter7
Total questions: 14
Worksheet time: 7mins
What is the purpose of the Get-Process command in PowerShell?
To display information about running processes
To display information about running processes
To stop a running process
None of the above
What is the purpose of the Set-ExecutionPolicy command in PowerShell
.To set the execution policy for scripts
To set the execution policy for cmdlets
To set the execution policy for both scripts and cmdlets
None of the above
Which command is used to rename a file or directory in PowerShell?
Move-Item
Rename-Item
.Copy-Item
None of the above
How do you declare a type of variable when declaring a variable?
With parentheses surrounding the type of variable before the declaration (ie. "(integer) $variable"
With square brackets surrounding the type of variable before the declaration (ie. "[integer] $variable"
.By stating that the variable equals the type of variable before declaring the actual variable (ie. "$variable=integer")
.You cannot declare the type of variable, powershell does this automatically when you declare the variable for the first time.
How can you make a variable display the current date and time?
Create an [object] variable set to get-date
Create a [datetime] variable set to get-date
.Create an [integer] variable set to get-date
Create a [timespan] variable set to get-date
What is the command to write something to the console display?
draw-host
write-host
.draw-output
.write-output
What is PowerShell?
A programming language for web development
A command-line shell and scripting language
A markup language for creating documents
A database management system
Which command is used to create a new directory in PowerShell
md
dir
cd
rd
What does the command “Get-ChildItem” do in PowerShell?
Lists all child processes of the current process
Lists all child objects in a directory
Gets information about a specified child item
None of the above
Which command is used to get information about the PowerShell version that is installed on a system?
Get-Version
Show-Version
Get-Host
None of the above
What is the purpose of the Get-Process command in PowerShell?
To display information about running processes
To start a new process
To stop a running process
None of the above
Which command is used to create a new folder in PowerShell?
New-Folder
Create-Folder
New-Item
None of the above
Which command is used to display the environment variables in PowerShell?
Get-Environment
Show-Environment
Set-Environment
None of the above
Which command is used to set the execution policy in PowerShell?
Set-ExecutionPolicy
Update-ExecutionPolicy
Set-Policy
None of the above
