
Figure 1.2: First commands in the PowerShell console
For example, if you'd like to see which files and folders are in your current directory, then type dir (Enter). You'll get a textlisting of all the files in the directory. PowerShell's communication with you is always text-based. PowerShell can do muchmore than display simple directory lists. You can just as easily list all running processes or all installed hotfixes: Just pick adifferent command as the next one provides a list of all running processes:Get-Process (Enter)Get-Hotfix (Enter)
PowerShell's advantage is its tremendous flexibility since it allows you to control and display nearly all the information andoperations on your computer. The command cls deletes the contents of the console window and the exit command endsPowerShell.
Incomplete and Multi-line Entries
Whenever you enter something PowerShell cannot understand, you get a red error message, explaining what went wrong.However, if you enter something that isn't wrong but incomplete (like a string with one missing closing quote), PowerShellgives you a chance to complete your input. You then see a double-prompt (">>"), and once you completed the line and
pressed ENTER twice, PowerShell executes the command. You can also bail out at any time and cancel the current commandor input by pressing: (Ctrl)+(C).
The "incomplete input" prompt will also appear when you enter an incomplete arithmetic problem like this one:
2 >> 6 + (Enter)>> (Enter)(Enter)8
This feature enables you to make multi-line PowerShell entries:
"This is my little multiline entry.(Enter)
>> >> I'm now writing a text of several lines. (Enter)
>>(Enter)
And I'll keep on writing until it's no longer fun."(Enter)This is my little multiline entry.
I'm now writing a text of several lines.
And I'll keep on writing until it's no longer fun.
The continuation prompt generally takes its cue from initial and terminal characters like open and closed brackets or quotationmarks at both ends of a string. As long as the symmetry of these characters is incorrect, you'll continue to see the prompt.However, you can activate it even in other cases:
dir `>> (Enter)
>>(Enter)
-recurse(Enter)So, if the last character of a line is what is called a "back-tick" character, the line will be continued. You can retrieve thatspecial character by pressing (`).
Important Keyboard Shortcuts
该 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 ...
热门文档