Www.nku.edu



Name: ________________________________Lab#23 PowerShell CIT271Log onto Windows 2012 as Administrator.PowerShell may be on your Desktop Taskbar (a blue icon with a >_) and on the Start page. Open PowerShell.On your host machine, look up PowerShell in Wikipedia. What is PowerShell?Answer #A:What is a PowerShell cmdlet? (See PowerShell on Wikipedia.)Answer #B:PowerShell is object-oriented. Cmdlets are of the form <verb>-<noun> such as Get-ChildItem. What are some of the verbs are used with PowerShell commands? (See Comparison of cmdlets with similar commands.)What does the get verb mean in a cmdlet? Answer #C:Run the command get-process. What is this command similar to in Windows Server 2012? (See pages 379-380 and Figure 10.6)Answer #D:Run the command get-process w* | format-list.What does the asterisk after w (w*) mean? (If you need to, ask.)What does the vertical bar “|” mean? (If you need to, ask.) Answer #E:Run get-help get-process. Run the update if necessary. What does the output show you? Answer #F:Run the following commands:get-process powershellwrite $pidWhat information does the variable $pid contain? Answer #G:Type $pid followed by a period “.”. Then, press Tab to cycle through all of the methods that are available. Find the getType() method. What is the name of the data type for $pid? Answer #H:Run the command get-alias | more. With the more command, you can get the next line by pressing the return key. You can show the next screen by pressing the space bar. You can quit more by typing “q”. The command cd is an alias for what cmdlet? Answer #I:Try it out. cd DocumentsUse the cmdlet to do the equivalent of cd .. (This means move change to the parent directory.)What cmdlet did you use in Step b? Answer #J:A) The alias dir is the alias for what cmdlet? B) What is another alias for this cmdlet?Answer #K:Enter the command get-psdrive. PowerShell can be used with both the file system, the Registry and Environment variables. Navigate to the HKEY_CURRENT_USER Registry key. What command did you use? (Hint: You need to place a colon after a PowerShell drive.)Answer #L:Enter the command cd Software. Enter the command cd Microsoft.Enter the command dir and look at the Notepad entry.What is the value of the property iWindowPosX and B) what does it represent? (You can Google for iWindowPosX.) Answer #M:Enter the command get-psdrive. To access Environment variables, what command would you use? Enter this command. Answer #N:Type dir. Enter the command Write-Host $env:systemroot. A) What was displayed? B) Display the value of the environment variable USERNAME. What command did you use? Answer #O:Enter the command $public = $env:public to store the environment variable in a simple variable.Enter a command to determine the value of $public. A) What is the value of $public? B) What command did you use? Answer #P:Enter the command Notepad in PowerShell. What was the result of this command? Answer #Q:Enter the command get-process. Enter the commands get-help stop-process. What command would you use to stop the Notepad process with confirmation? Enter this command. Answer #R:Enter the commandget-historyYou can also use this commands alias. Enter the command h What does this command show?Answer #S In previous questions, record the number of a command where you entered get-process. Replace 99 in with this number. Enter the commandinvoke-history 99You can also use this commands alias. Enter the command again replacing 99 with the number ihy 99What command did you enter? B) What does this command accomplish?Answer #T: ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download