

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:
该 cmdlet 可复制的特定项 取决于可用的 Windows PowerShell 提供程序。例如,与 FileSystem 提供程序一 起使用时,它可以复制文件和目录;与 Registry 提供程序一起...
PowerShell 基础知识之一本 Blog 所发表的所有"原创文章", 未经许可, 禁止以任何形式进行转载. 作者: Edengundam(马涛) 如果要学一门语言, 你就必须对语言的...
PowerShell 1.0 用户指南_互联网_IT/计算机_专业资料。PowerShell 1.0 用户指南Windows PowerShell 语言快 速参考为不同类型的系统提供的本机支持 Windows ...
本文档介绍了 Windows PowerShell 的基本概念和功能,并提供了一些使用 Windows PowerShell 进行系统管理的建议方法。 目录 Windows PowerShell 入门版权声明 ... 8 Win...
Console Pane Go to Script Pane Cycle through command history Scroll to the...$psISE.CurrentPowerShellTab Defines the properties of the current PowerShell ...
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 若要从“开始”菜单启动 Windows PowerShell,请依次单击“开始”“所有程序” Windows 、、 PowerShell 1.0 和 Windows PowerShell。 若要...
向 Windows PowerShell 对象的实例中添加用户定义的自定义成 将一个或多个 ...Console Export-Counter Export-CSV Export-FormatData Export-ModuleMember Export-...
Key Message The Active Directory module for Windows PowerShell in Windows ...Console (MMC) snap-ins to connect to their Active Directory domains and ...
方法如下:首先启 动安装好的Powershell,在命令窗口中输入如下命 令并回车: PS C:\> Export-Console myconsole ? 10.2.3 配置PowerShell ? ? 配置Windows ...
热门文档