这次,所有别名都来了,还真不少呢?微软,你为什么搞那么长的名字,搞得我们老是敲字,想让我们变鼠标手吗?玩笑,别当真,这种设计代表了另一种思想,大家懂得。不过,我的23寸的屏幕都没把所有别名显示完毕,要不把输出内容重定向到一个文本文件中,再贴出来,这个早已出现在DOS和提示符种的功能应该没有被阉割吧。
我输入了命令Get-Alias >e:\x.txt,好像硬盘灯在闪,说明在写文件,那么这种重定向功能应该还是好用的,事实上文件内容也验证了我的想法。
CommandType Name ModuleName
----------- ---- ----------
Alias % -> ForEach-Object
Alias ? -> Where-Object
Alias ac -> Add-Content
Alias asnp -> Add-PSSnapin
Alias cat -> Get-Content
Alias cd -> Set-Location
Alias chdir -> Set-Location
Alias clc -> Clear-Content
Alias clear -> Clear-Host
Alias clhy -> Clear-History
Alias cli -> Clear-Item
Alias clp -> Clear-ItemProperty
Alias cls -> Clear-Host
Alias clv -> Clear-Variable
Alias cnsn -> Connect-PSSession
Alias compare -> Compare-Object
Alias copy -> Copy-Item
Alias cp -> Copy-Item
Alias cpi -> Copy-Item
Alias cpp -> Copy-ItemProperty
Alias cvpa -> Convert-Path
Alias dbp -> Disable-PSBreakpoint
Alias del -> Remove-Item
Alias diff -> Compare-Object
Alias dir -> Get-ChildItem
Alias dnsn -> Disconnect-PSSession
Alias ebp -> Enable-PSBreakpoint
Alias echo -> Write-Output
Alias epal -> Export-Alias
Alias epcsv -> Export-Csv
Alias epsn -> Export-PSSession
Alias erase -> Remove-Item
Alias etsn -> Enter-PSSession
Alias exsn -> Exit-PSSession
Alias fc -> Format-Custom
Alias fl -> Format-List
Alias foreach -> ForEach-Object
Alias ft -> Format-Table
Alias fw -> Format-Wide
Alias gal -> Get-Alias
Alias gbp -> Get-PSBreakpoint
Alias gc -> Get-Content
Alias gci -> Get-ChildItem
Alias gcm -> Get-Command
Alias gcs -> Get-PSCallStack
Alias gdr -> Get-PSDrive
Alias ghy -> Get-History
Alias gi -> Get-Item
Alias gjb -> Get-Job
Alias gl -> Get-Location
Alias gm -> Get-Member
Alias gmo -> Get-Module
Alias gp -> Get-ItemProperty
Alias gps -> Get-Process
Alias group -> Group-Object
Alias gsn -> Get-PSSession
Alias gsnp -> Get-PSSnapin
Alias gsv -> Get-Service
Alias gu -> Get-Unique
Alias gv -> Get-Variable
Alias gwmi -> Get-WmiObject
Alias h -> Get-History
Alias history -> Get-History
Alias icm -> Invoke-Command
Alias iex -> Invoke-Expression
Alias ihy -> Invoke-History
Alias ii -> Invoke-Item
Alias ipal -> Import-Alias
Alias ipcsv -> Import-Csv
Alias ipmo -> Import-Module
Alias ipsn -> Import-PSSession
Alias irm -> Invoke-RestMethod
Alias ise -> powershell_ise.exe
Alias iwmi -> Invoke-WmiMethod
Alias iwr -> Invoke-WebRequest
Alias kill -> Stop-Process
Alias lp -> Out-Printer
Alias ls -> Get-ChildItem
Alias man -> help
Alias md -> mkdir
Alias measure -> Measure-Object
Alias mi -> Move-Item
Alias mount -> New-PSDrive
Alias move -> Move-Item
Alias mp -> Move-ItemProperty
Alias mv -> Move-Item
Alias nal -> New-Alias
Alias ndr -> New-PSDrive
Alias ni -> New-Item
Alias nmo -> New-Module
Alias npssc -> New-PSSessionConfigurationFile
Alias nsn -> New-PSSession
Alias nv -> New-Variable
Alias ogv -> Out-GridView
Alias oh -> Out-Host
Alias popd -> Pop-Location
Alias ps -> Get-Process
Alias pushd -> Push-Location
Alias pwd -> Get-Location
Alias r -> Invoke-History
Alias rbp -> Remove-PSBreakpoint
Alias rcjb -> Receive-Job
Alias rcsn -> Receive-PSSession
Alias rd -> Remove-Item
Alias rdr -> Remove-PSDrive
Alias ren -> Rename-Item
Alias ri -> Remove-Item
Alias rjb -> Remove-Job
Alias rm -> Remove-Item
Alias rmdir -> Remove-Item
Alias rmo -> Remove-Module
Alias rni -> Rename-Item
Alias rnp -> Rename-ItemProperty
Alias rp -> Remove-ItemProperty
Alias rsn -> Remove-PSSession
Alias rsnp -> Remove-PSSnapin
Alias rujb -> Resume-Job
Alias rv -> Remove-Variable
Alias rvpa -> Resolve-Path
Alias rwmi -> Remove-WmiObject
Alias sajb -> Start-Job
Alias sal -> Set-Alias
Alias saps -> Start-Process
Alias sasv -> Start-Service
Alias sbp -> Set-PSBreakpoint
Alias sc -> Set-Content
Alias select -> Select-Object
Alias set -> Set-Variable
Alias shcm -> Show-Command
Alias si -> Set-Item
Alias sl -> Set-Location
Alias sleep -> Start-Sleep
Alias sls -> Select-String
Alias sort -> Sort-Object
Alias sp -> Set-ItemProperty
Alias spjb -> Stop-Job
Alias spps -> Stop-Process
Alias spsv -> Stop-Service
Alias start -> Start-Process
Alias sujb -> Suspend-Job
Alias sv -> Set-Variable
Alias swmi -> Set-WmiInstance
Alias tee -> Tee-Object
Alias trcm -> Trace-Command
Alias type -> Get-Content
Alias where -> Where-Object
Alias wjb -> Wait-Job
Alias write -> Write-Output
看完这个,心里是不是轻松了好多,原来DOS/批处理中好多东西都还在。
说到这里,网上的高手们,教我看另一个东西,我也向大家介绍一下,半集成化编辑调试环境,Windows PowerShell ISE。
下面看看官方的说法。
什么是 WMI?
WMI最初于 1998 年作为一个附加组件与 Windows NT 4.0 Service Pack 4 一起发行,是内置在 Windows 2000、Windows XP 和 Windows Server 2003 系列操作系统中核心的管理支持技术。WMI 是一种规范和基础结构,通过它可以访问、配置、管理和监视所有的 — 几乎所有的 Windows 资源:例如磁盘、事件日志、文件、文件夹、文件系统、网络组件、操作系统设置、性能数据、打印机、进程、注册表设置、安全性、服务、共享、用户、组等等。 并且不同于图形界面的是,系统管理员可以使用 WMI 脚本库创建系统管理脚本,批量自动化管理相关资源。
WMI 由三个主要组件构成:公共信息模型对象管理器(Common Information Model Object Manager,CIMOM)、公共信息模型(Common Information Model,CIM)储存库,以及提供程序。这三个 WMI 组件共同提供通过其定义、公开、访问和检索配置和管理数据的基础结构。虽然小,但是对编写脚本来说绝对不可或缺的第四个组件是 WMI 脚本库。