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
How can I use PowerShell to See If WinRM Is configured on a group of Remote Computers? |
"s1","s2","dc1" | % { Test-WSMan $_ } |
|
How can I test connectivity to remote servers to ensure my Windows PowerShell scripts will work if I have the PING blocked at the firewall? |
Use Test-WsMan, for example: |
|
What is the best way to test for an UP server before attempting a connect to it? |
Test-Connection
|
|
How can you run Test-Connection, then if UP, do something? |
if (Test-Connection -ComputerName www.google.com -Quiet){Write-Host "Found the site ok"} else {Write-host "Didn't find it"} |
|
What purpose does the ForEach-Object serve? |
The ForEach-Object cmdlet performs an operation on each item in a collection of input objects. |
|
What are two ways that you can use ForEach-Object to get the value of the ProcessName property of each process on the computer? |
Get-Process | ForEach-Object {$_.ProcessName} |
|
Using the Get-WindowsFeature cmdlet, display a list of server roles and features that are currently installed: |
Import-Module ServerManager |
|
What end of the command should you do formatting? |
Format Right - Format at the end of the commands. |
|
What end of the command should you do filtering? |
Filter Left - It is more efficient to filter returning data as close to the source of data as possible. e.g. filter the system event log on the server, and then return the data. |
|
Although you can use 'NETDOM QUERY FSMO' to list domain controllers that hold the FSMO roles, how can you do it with Windows PowerShell? |
Get-ADDomain | Select-Object InfrastructureMaster, RIDMaster, PDCEmulator
|
|
What does having a command in parentheses achieve? e.g. (Get-Service -Name gupdate).DisplayName |
The parentheses will force PowerShell to first execute the command inside the parentheses, then do the item to the right. |
|
The $_ symbol is a system variable that does what? |
Points to the current object in the pipeline - followed by a period and the name of a property. |
|
How can you chain two commands together on the same line? |
Semicolon |
|
How do you continue a command over two lines? |
back tick
|
|
How to display a list of CMDLETS? |
get-command | more |
|
With Add-Content, how do you add a new line to a text file |
Add-Content c:\scripts\test.txt "`nThe End" |
|
How do you Add a timestamp to the end of bunch of .log files? |
$A = Get-Date; Add-Content c:\scripts\*.log $A |
|
What are the PowerShell versions installed in the OS by default? |
Windows 7/Server 2008 R2 - PowerShell 2.0 |
|
What are some notable features that shipped in PowerShell 2.0? |
PowerShell Remoting, Background Job, PowerShell Integrated Scripting Environment (ISE), Network File Transfer, Block Comments |
|
What are some notable features / changes that shipped in PowerShell 3.0? |
Scheduled jobs, Help update, Automatic module detection |
|
What are some notable features / changes that shipped in PowerShell 4.0? |
Desired State Configuration |
|
What are some notable features / changes that will probably ship in PowerShell 5.0? |
Key features include OneGet PowerShell scriptlets to support Chocolatey's repository-based package management and extending support for switch management to layer 2 network switches |
|
How can you show the operating system install date? |
gwmi -query 'Select InstallDate from CIM_OperatingSystem' -computername localhost -namespace root\cimv2 | Select InstallDate |
|
With PowerShell 2.0, how can you display a list of services that have a start type of Automatic, but that aren’t currently started? |
# This works with PowerShell 2.0 |
|
With PowerShell 3.0, how can you display a list of services that have a start type of Automatic, but that aren’t currently started? |
# This works with PowerShell 3.0 |