Powershell cmdlets Flashcards

(116 cards)

1
Q

What cmdlet lists all cmdlets and functions registered in the command shell

A

Get-Command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What cmdlet identifies the effective execution policy for the current PowerShell session?

A

Get-ExecutionPolicy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The ____ portion of a cmdlet name indicates what the cmdlet does.

A

Verb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What cmdlet verb retrieves a resource, such as a file or a user?

A

Get

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What cmdlet verb changes the data associated with a resource, such as a file or user property?

A

Set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What cmdlet verb creates a resource, such as a file or user?

A

New

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What cmdlet verb adds a resource to a container of multiple resources?

A

Add

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What cmdlet verb deletes a resource from a container of multiple resources?

A

Remove

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between read and get?

A

Read verb retrieves information that a resource contains, such as a text file’s content, whereas the Get verb retrieves the actual file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

____ names begin with a dash (-).

A

Parameter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

You can review a complete list of help topics by running

A

Get-Help about*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

_____ retrieves information about a command, or several commands, such as the name, category, version, and even the module that contains it.

A

Get-Command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The _____ ______ is a central repository for Windows PowerShell–related content, including scripts and modules.

A

PowerShell Gallery

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

_____ contains cmdlets for finding and installing modules, scripts, and commands from the online gallery.

A

PowerShellGet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

True or False:

Aliases typically support the parameters that the original commands use

A

False, aliases typically don’t support the parameters that the original commands use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The double-square-bracket notation in the parameter value type designates what parameters.

Example: -ComputerName <string[]>

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does this command do?

Get-Command -Noun alias*

A

This command searches for all cmdlets whose noun part starts with alias.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which PowerShell cmdlet lists all items in the current directory?

A

Get-ChildItem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which cmdlet shows the current working directory in PowerShell?

A

Get-Location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Which cmdlet changes the current directory?

A

Set-Location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Which cmdlet displays a list of running processes?
Get-Process
26
Which cmdlet stops a running process by name or ID?
Stop-Process
27
Which cmdlet shows currently running services?
Get-Service
28
Which cmdlet starts a stopped service?
Start-Service
29
Which cmdlet stops a running service?
Stop-Service
30
Which cmdlet retrieves event logs?
Get-EventLog
31
Which cmdlet shows the history of typed commands?
Get-History
32
Which cmdlet clears the command history?
Clear-History
33
Which cmdlet sends output to the screen or pipeline?
Write-Output
34
Which cmdlet prints colored or styled messages?
Write-Host
35
Which cmdlet reads user input from the terminal?
Read-Host
36
Which cmdlet retrieves system information like OS version?
Get-ComputerInfo
37
Which cmdlet lists all available commands?
Get-Command
38
Which cmdlet gets detailed help about a command?
Get-Help
39
Which cmdlet updates local help files?
Update-Help
40
Which cmdlet shows the properties and methods of objects?
Get-Member
41
Which cmdlet gets the value of a variable?
Get-Variable
42
Which cmdlet sets or creates a new variable?
Set-Variable
43
Which cmdlet removes a variable?
Remove-Variable
44
Which cmdlet lists all aliases?
Get-Alias
45
Which cmdlet creates a new alias?
Set-Alias
46
Which cmdlet removes an alias?
Remove-Alias
47
Which cmdlet creates a new file?
New-Item
48
Which cmdlet copies a file or folder?
Copy-Item
49
Which cmdlet moves a file or folder?
Move-Item
50
Which cmdlet deletes a file or folder?
Remove-Item
51
Which cmdlet creates a new folder?
New-Item -ItemType Directory
52
Which cmdlet reads the contents of a file?
Get-Content
53
Which cmdlet writes or overwrites file contents?
Set-Content
54
Which cmdlet appends content to a file?
Add-Content
55
Which cmdlet renames a file or folder?
Rename-Item
56
Which cmdlet finds a specific string in file content?
Select-String
57
Which cmdlet loops through items in a collection?
ForEach-Object
58
Which cmdlet applies filters to pipeline input?
Where-Object
59
Which cmdlet sorts pipeline output?
Sort-Object
60
Which cmdlet groups objects by a property?
Group-Object
61
Which cmdlet counts items in a collection?
Measure-Object
62
Which cmdlet compares two sets of objects?
Compare-Object
63
Which cmdlet pauses script execution?
Start-Sleep
64
Which cmdlet tests if a path exists?
Test-Path
65
Which cmdlet retrieves network adapter configuration?
Get-NetAdapter
66
Which cmdlet gets IP configuration settings?
Get-NetIPAddress
67
Which cmdlet pings a host?
Test-Connection
68
Which cmdlet gets firewall rules?
Get-NetFirewallRule
69
Which cmdlet enables a firewall rule?
Enable-NetFirewallRule
70
Which cmdlet disables a firewall rule?
Disable-NetFirewallRule
71
Which cmdlet schedules a task?
Register-ScheduledTask
72
Which cmdlet creates a scheduled task action?
New-ScheduledTaskAction
73
Which cmdlet creates a scheduled task trigger?
New-ScheduledTaskTrigger
74
Which cmdlet shows environment variables?
Get-ChildItem Env:
75
Which cmdlet sets an environment variable?
[Environment]::SetEnvironmentVariable
76
Which cmdlet executes external programs?
Start-Process
77
Which cmdlet waits for a process to complete?
Wait-Process
78
Which cmdlet restarts a computer?
Restart-Computer
79
Which cmdlet shuts down a computer?
Stop-Computer
80
Which cmdlet gets local user accounts?
Get-LocalUser
81
Which cmdlet creates a new local user?
New-LocalUser
82
Which cmdlet removes a local user?
Remove-LocalUser
83
Which cmdlet changes a local user password?
Set-LocalUser
84
Which cmdlet gets scheduled tasks?
Get-ScheduledTask
85
Which cmdlet disables a scheduled task?
Disable-ScheduledTask
86
Which cmdlet enables a scheduled task?
Enable-ScheduledTask
87
Which cmdlet gets local groups?
Get-LocalGroup
88
Which cmdlet adds a user to a group?
Add-LocalGroupMember
89
Which cmdlet removes a user from a group?
Remove-LocalGroupMember
90
Which cmdlet gets system uptime?
(Get-CimInstance Win32_OperatingSystem).LastBootUpTime
91
Which cmdlet imports a CSV file?
Import-Csv
92
Which cmdlet exports data to CSV?
Export-Csv
93
Which cmdlet converts data to JSON?
ConvertTo-Json
94
Which cmdlet converts JSON to objects?
ConvertFrom-Json
95
Which cmdlet gets installed programs via registry?
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
96
Which cmdlet lists modules installed?
Get-Module -ListAvailable
97
Which cmdlet imports a PowerShell module?
Import-Module
98
Which cmdlet installs a PowerShell module?
Install-Module
99
Which cmdlet uninstalls a PowerShell module?
Uninstall-Module
100
Which cmdlet updates a PowerShell module?
Update-Module
101
Which cmdlet runs a script block remotely?
Invoke-Command
102
Which cmdlet creates a remote session?
New-PSSession
103
Which cmdlet enters an interactive session?
Enter-PSSession
104
Which cmdlet removes a remote session?
Remove-PSSession
105
Which cmdlet signs a script?
Set-AuthenticodeSignature
106
Which cmdlet gets execution policy?
Get-ExecutionPolicy
107
Which cmdlet sets execution policy?
Set-ExecutionPolicy
108
Which cmdlet validates syntax of a script?
Parse-Script
109
Which cmdlet defines a new function?
function MyFunction { ... }
110
Which cmdlet returns from a function?
return
111
Which cmdlet throws an error?
throw
112
Which cmdlet handles exceptions?
try { ... } catch { ... }
113
Which cmdlet retrieves command history from a session?
Get-History
114
Which cmdlet evaluates a string as code?
Invoke-Expression
115
Which cmdlet gets help in a web browser?
Get-Help -Online
116
Which cmdlet checks for PowerShell version?
$PSVersionTable.PSVersion