Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
25 Cards in this Set
- Front
- Back
What is the fix for "The script is not digitally signed. The script will not execute on the system." |
Set-ExecutionPolicy Unrestricted |
|
What is the command to tell what PowerShell version is use? |
$PSVersionTable |
|
How to start the PowerShell ISE from command line? |
PowerShell_ISE.exe |
|
How do you enable PS Remoting for a system? |
Enable-PSRemoting |
|
How do you search the C drive for a file called test.txt? |
Get-ChildItem c:\ test.txt -Recurse -Force -ErrorAction SilentlyContinue | Select-Object FullName,LastWriteTime |
|
How do you search the C drive for a file called test.txt using the Get-ChildItem alias? |
gci c:\ test.txt -r -fo -ea silentlycontinue | select fullname,lastwritetime |
|
How can you search for a file on a remote system and write the contents out to CSV? |
gci \\DC1\c$\ notepad.exe -r -fo -ea silentlycontinue | Select FullName,LastWriteTime | Export-CSV ListFileInfo-DC1.csv
|
|
What are the commands to start and stop a VM on Hyper-V? |
Start-VM –Name ComputerName |
|
How do you turn off a hung VM in Hyper-V? |
Stop-VM –Name ComputerName –TurnOff |
|
How can you get a list of stopped services quickly? |
Get-Service | where {$_.status -eq "Stopped" } | Out-GridView |
|
How do you run a PowerShell command (e.g. kill process) on a remote machine? |
Invoke-Command -computername machineName {Stop-Process -processname "ProcessName"} |
|
How do you run a PowerShell command (e.g. gpupdate & restart) on a remote machine? |
Invoke-Command -computername DC1 {gpupdate /force}
|
|
How do you run a PowerShell command (e.g. gpupdate & restart) on a multiple remote machines? |
Invoke-Command (Get-Content C:\Temp\ServerList.txt) {gpupdate /force} |
|
How can I use Windows PowerShell to compare the contents of two files? |
Compare-Object -ReferenceObject (Get-Content .\diskcapacity.csv) -DifferenceObject (Get-Content .\diskcapacity2.csv) |
|
How do you grab a string that you are interested from a bunch of info? |
# Use .Property, e.g. $treg = Get-ItemProperty -path hkcu:\software\Citrix\Dazzle\ -name FirstRunInstalledDate |
|
Read a registry value using the PS method |
Get-ItemProperty -path hkcu:\software\something\ -name SomeStringName |
|
Set a registry value using the PS method |
Set-ItemProperty -path hkcu:\software\something\ -name SomeStringName -value SomeValue |
|
Set a registry value - using the REG ADD add method |
Invoke-Command {reg add HKCU\software\something /v TestString1 /t REG_SZ /d TestData /f} |
|
What symbol is an alias for the Foreach-Object cmdlet? |
Note % is an alias for the Foreach-Object cmdlet |
|
What two symbols are used to represent objects? |
In the example below, the "$_" symbol represents each object that is passed to the Where-Object cmdlet. |
|
What is the difference between a Script block and a Comparison statement? |
Script block: |
|
What is the difference between Select-Object & Where-Object? |
Select-Object is used to choose the Properties (or columns) you want to see. |
|
What purpose does the Where-Object cmdlet serve? |
The Where-Object cmdlet selects objects that have particular property values from the collection of objects that are passed to it. |
|
What purpose does the Select-Object cmdlet serve? |
The Select-Object cmdlet selects specified properties of an object or set of objects. It can also select unique objects, a specified number of objects, or objects in a specified position in an array. |
|
How can you reveal hidden properties? |
Get-Hotfix | Format-List * -force |