文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 电脑基础知识 > Chapter 1. The PowerShell Console
侵权投诉

Chapter 1. The PowerShell Console

Chapter 1. The PowerShell Console

Chapter 1. The PowerShell Console

Shortcuts are important since almost everything in PowerShell is keyboard-based. For example, by pressing the keys

(Arrow left) and (Arrow right), you can move the blinking cursor to the left or right. Use it to go back and correct a typo. If youwant to move the cursor word by word, hold down (Ctrl) while pressing the arrow keys. To place the cursor at the beginning ofa line, hit (Home). Pressing (End) will send the cursor to the end of a line.

If you haven't entered anything, then the cursor won't move since it will only move within entered text.There's one exception: if you've already entered a line and pressed (Enter) to execute the line, you canmake this line appear again character-by-character by pressing (Arrow right).

Deleting Incorrect Entries

If you've mistyped something, press (Backspace) to delete the character to the left of the blinking cursor. (Del) erases thecharacter to the right of the cursor. And you can use (Esc) to delete your entire current line.

The hotkey (Ctrl)+(Home) works more selectively: it deletes all the characters at the current position up to the beginning of theline. Characters to the right of the current position (if there are any) remain intact. (Ctrl)+(End) does it the other way aroundand deletes everything from the current position up to the end of the line. Both combinations are useful only after you'vepressed (Arrow left) to move the cursor to the middle of a line, specifically when text is both to the left and to the right of thecursor.

Overtype Mode

If you enter new characters and they overwrite existing characters, then you know you are in type-over mode. By pressing(Insert) you can switch between insert and type-over modes. The default input mode depends on the console settings youselect. You'll learn more about console settings soon.

Command History: Reusing Entered Commands

The most awesome feature is a built-in search through all of the commands you used in your current session: simply type "#"and then some search text that you know exists in one or more of your previous commands. Next, type TAB one or more

times to see all the commands that contained your keyword. Press ENTER to execute the command once you found it, or editthe command line to your liking.

If you just wanted to polish or correct one of your most recent commands, press (Arrow up) to re-display the command thatyou entered. Press (Arrow up) and (Arrow down) to scroll up and down your command history. Using (F5) and (F8) do thesame as the up and down arrow keys.

This command history feature is extremely useful. Later, you'll learn how to configure the number of commands the console“remembers”. The default setting is the last 50 commands. You can display all the commands in your history by pressing (F7)and then scrolling up and down the list to select commands using (Arrow up) and (Arrow down) and (Enter).

The numbers before the commands in the Command History list only denote the sequence number.You cannot enter a number to select the associated command. What you can do is move up and downthe list by hitting the arrow keys.

Simply press (F9) to ‘activate’ the numbers so that you can select a command by its number. This

opens a menu that accepts the numbers and returns the desired command.

The keyboard sequence (Alt)+(F7) will clear the command history and start you off with a new list.

(F8) provides more functionality than (Arrow up) as it doesn't just show the last command you entered, but keeps a record ofthe characters you've already typed in. If, for example, you'd like to see all the commands you've entered that begin with "d",type:

d(F8)

Press (F8) several times. Every time you press a key another command will be displayed from the command history providedthat you've already typed in commands with an initial "d."

Automatically Completing Input

An especially important key is (Tab). It will save you a great deal of typing (and typing errors). When you press this key,PowerShell will attempt to complete your input automatically. For example, type:

cd (Tab)

The command cd changes the directory in which you are currently working. Put at least one space behind the command andthen press (Tab). PowerShell suggests a sub-directory. Press (Tab) again to see other suggestions. If (Tab) doesn't come upwith any suggestions, then there probably aren't any sub-directories available.

This feature is called Tab-completion, which works in many places. For example, you just learned how to use the commandGet-Process, which lists all running processes. If you want to know what other commands there are that begin with "Get-",then type:

上一页第4页

你可能喜欢

热门文档

相关文档

  • 1、PowerShell帮助篇

    该 cmdlet 可复制的特定项 取决于可用的 Windows PowerShell 提供程序。例如,与 FileSystem 提供程序一 起使用时,它可以复制文件和目录;与 Registry 提供程序一起...

  • PowerShell基础知识之一

    PowerShell 基础知识之一本 Blog 所发表的所有"原创文章", 未经许可, 禁止以任何形式进行转载. 作者: Edengundam(马涛) 如果要学一门语言, 你就必须对语言的...

  • PowerShell 1.0 用户指南

    PowerShell 1.0 用户指南_互联网_IT/计算机_专业资料。PowerShell 1.0 用户指南Windows PowerShell 语言快 速参考为不同类型的系统提供的本机支持 Windows ...

  • PowerShell 1.0 入门指南

    本文档介绍了 Windows PowerShell 的基本概念和功能,并提供了一些使用 Windows PowerShell 进行系统管理的建议方法。 目录 Windows PowerShell 入门版权声明 ... 8 Win...

  • PowerShell_ISE_v3

    Console Pane Go to Script Pane Cycle through command history Scroll to the...$psISE.CurrentPowerShellTab Defines the properties of the current PowerShell ...

  • PowerShell_Examples_v3

    Windows PowerShell 3.0 Examples Created by http://powershellmagazine.com How...The webpage is entirely Javascript-based, so you can access the console ...

  • Windows PowerShell 1.0 入门

    启动 Windows PowerShell 若要从“开始”菜单启动 Windows PowerShell,请依次单击“开始”“所有程序” Windows 、、 PowerShell 1.0 和 Windows PowerShell。 若要...

  • powershell命令大全

    向 Windows PowerShell 对象的实例中添加用户定义的自定义成 将一个或多个 ...Console Export-Counter Export-CSV Export-FormatData Export-ModuleMember Export-...

  • Windows Server 2008 R2 Powershell 命令的使用

    Key Message The Active Directory module for Windows PowerShell in Windows ...Console (MMC) snap-ins to connect to their Active Directory domains and ...

  • 第10章 Windows_PowerShell脚本编程

    方法如下:首先启 动安装好的Powershell,在命令窗口中输入如下命 令并回车: PS C:\> Export-Console myconsole ? 10.2.3 配置PowerShell ? ? 配置Windows ...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email