首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
中国IT教育
Google
您现在的位置: 中国IT实验室 >> Windows >> 系统技巧 >> 系统管理 >> 正文

Windows PowerShell中12项酷功能

      微软windowsvistablog上,开发人员列举了Windows Vista中Windows PowerShell所提供的12项酷酷的功能:

  解答PowerShell:PowerShell原来的开发代号是Monad,原计划是用以替代Windows中的命令行工具,但是后来微软说它只是技术上的扩充。使用PowerShell,管理员可以做任何在图形界面下所做的事情。Windows PowerShell 1.0可以运行在Windows XP SP2、Windows Server 2003和Windows Vista上。

  1. 内置Cmdlets (即"commandlets")

  Windows PowerShell中的所有Cmdlets都允许这样的动名词:get-service, get-process, stop-service, get-wmiobject.

  2. 强大的通配符和操作对象

  要得到以w开头的服务及其依赖服务只要输入: 

PS> get-service w*   format-list DisplayName, DependentServices
  3. 在犯错误前测试命令

  Windows PowerShell 有意向独特的功能:Whatif ,可以不执行命令就告诉你命令执行结果.如: 

PS> stop-service w3* -whatif
  4. 获取副本

  PowerShell 可以开始和结束所有命令的副本,可以在脚本中轻易测试命令并同时保存.  

PS> Start-Transcript -Path c:demodfoshow.txt
PS> Stop-Transcript
  5. 从命令行发布Windows对话

  因为Windows PowerShell位对象而优化,可以向.NET Framework一样从命令行访问COM对象,下列命令告诉你的Vista机器发表"Windows Vista and PowerShell"字串.  

PS> $spVoice = new-object -com "SAPI.spvoice"
PS> $spVoice.Speak("Windows Vista and PowerShell")
  6. 使用Windows PowerShell访问诸如Windows Media Player 11等的应用程序  
PS> $band = "The Posies"
PS> $player = New-object -com wmplayer.ocx
PS> $playlist = $player.mediacollection.getbyauthor($band)
PS> $player.openPlayer($playlist.item(0).sourceurl)
  7. Windows PowerShell作为命令行存储计算器

  PowerShell可以完成基本的计算工作  

PS> 2*2
  不过,Windows PowerShell也可以快速解决存储问题,例如,备份11GB的数据需要多少个700MB的CD.  
PS> 11gb/700mb
  那么,需要多少个1000GB的存储来备份每个320GB,共425个的Vista桌面呢?  
PS > (320gb*425)/1000GB
   

[1] [2] 下一页

【责编:Zenghui】

中国IT教育

相关产品和培训
文章评论
 友情推荐链接
 专题推荐

 ·带你领略windows系统“另类”安装
 ·“调教”磁盘,让Vista更在行
 ·windows系统性能优化专题
 ·windows系统安全——系统进程与病毒
 ·Windows 平台搭建VPN攻略…
 ·Windiws 系统备份与还原…
 ·专题:Windows Vista系统新特性…
 ·Windows server 2008专题报道…
 ·关注未来 关注Windows Vista成长…
 ·明明白白 学会Windows权限设置…
 今日更新
 认证培训
 频道精选
 Windows频道导航