PowerShell Flashcards
*
Wildcard that sets up a match with any number of characters
?
Wildcard that sets up a match with a single character
$env:path
Shows the default path PowerShell will use to search for the script you entered.
Get-Process
Shows all the currently running processes
“-Processname” allows you to specific a specific parameter
Get-ChildItem
Retrives the contents of the current folder, or one you specify the path to.
Aliases: dir, ls
get-service winrm
Checks if WinRM is running
start-service winrm
Starts WinRM
&$pshome\configure-wsman.ps1
Configures the WS-Management protocol to work with PowerShell
Get-Host
The cmdlet for programmatically configuring the Windows PowerShell console.
Clear-Host
Refreshes the console window and forces the immediate application of the Get-Host configuration options you just set.
Get-History
Accesses the history buffer commands and inserts them into the Windows PowerShell pipeline allowing you to programmatically access and manipulate them.
Invoke-History
Takes as an argument a number representing the position of a command in the history buffer.
Get-PSProvider
Shows a listing of all providers supported by Windows PowerShell.
Get-PSDrive
Displays a listing of available drives and the provider with which they are associated.
Set-Location
Changes the current drive.
Aliases: sl, cd, pwd, chdir
Read-Host
Pauses the script until the users presses enter
Up arrow
Moves back one position in the command line history buffer
Down arrow
Moves forward one position in the command line history buffer
Page up
Moves to the first command stored in the command line history buffer
Page down
Moves to the last command stored in the command line history buffer
Home
Jumps the cursor to the beginning of the command line
End
Jumps the cursor to the end of the command line
Control+Left
Moves the cursor to the left a word at a time
Control+Right
Moves the cursor to the right a word at a time
Get-Member
Gets the properties, methods, typeinfo, and property sets of the objects given to it.
Select-Object
Selects objects based on parameters set in the cmdlet command string.
About-PSJob
Provides a high-level overview of how to work with background jobs.
Start-PSJob
Creates and executes a new local or remote background job.
Receive-PSJob
Retrieves output generated by a background job. Once retrieved, the output is removed and no longer retrievable, unless you use the -keep argument.
Wait-PSJob
Instructs PowerShell to wait for a background job to complete.
Stop-PSJob
Halts the execution of a background job. Can use either its session ID or its state,
Get-PSJob
Retrieves information about the status of a background job using the session ID number.
Remove-PSJob
Deletes a background job object (including all of its output).
New-Runspace
Sets up a persistent runspace in which to execute remote jobs.
Get-Service
Gets a list of services.
Start-Sleep
Puts your PowerShell script to sleep for a specified period of time (in seconds).
Where-Object
Removes objects failing to meet a specified criteria. A filter.
$_
A special variable created and maintained by Windows PowerShell. It is automatically assigned the name of the current object in the pipeline and can reference each object in a collection.