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

Chapter 1. The PowerShell Console

Chapter 1. The PowerShell Console

Figure 1.8: Select better colors for your console

Directly Assigning Modifications in PowerShell

Some of the console configuration can also be done from within PowerShell code. You'll hear more about this later. To giveyou a quick impression, take a look at this:

$host.ui.rawui (Enter)

$host.ui.rawui.ForegroundColor = "Yellow" (Enter)$host.ui.rawui.WindowTitle = "My Console" (Enter)

These changes will only be temporary. Once you close and re-open PowerShell, the changes are gone. You would have toinclude these lines into one of your "profile scripts" which run every time you launch PowerShell to make them permanent. Youcan read more about this in Chapter 10.

Saving Changes

Once you've successfully specified all your settings in the dialog box, you can close the dialog box. If you're using WindowsVista or above, all changes will be saved immediately, and when you start PowerShell the next time, your new settings willalready be in effect. You may need Admin rights to save settings if you launched PowerShell with a link in your start menu thatapplies for all users.

If you're using Windows XP, you'll see an additional window and a message asking you whether you want to save changestemporarily (Apply properties to current window only) or permanently (Modify shortcut that started this window).

Piping and Routing

You may want to view the information page by page or save it in a file since some commands output a lot of information.

Piping: Outputting Information Page by Page

The pipe command more outputs information screen page by screen page. You will need to press a button (like Space) tocontinue to the next page.

Piping uses the vertical bar (|). The results of the command to the left of the pipe symbol are then fed into the command on theright side of the pipe symbol. This kind of piping is also known in PowerShell as the "pipeline":

Get-Process | more (Enter)

You can press (Ctrl)+(C) to stop output. Piping also works with other commands, not just more. For example, if you’d like toget a sorted directory listing, pipe the result to Sort-Object and specify the columns you would like to sort:

dir | Sort-Object -Property Length, Name (Enter)

You'll find more background information on piping as well as many useful examples in Chapter 5.

上一页第10页

你可能喜欢

热门文档

相关文档

  • 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