PowerShell 命令表(全)
- 格式:xls
- 大小:56.00 KB
- 文档页数:8
cmd批处理命令及powershellPowershell查询IP地址及主机名信息:1.foreach($ipv4 in (ipconfig) -like '*IPv4*') { ($ipv4 -split ' : ')[-1]}2.Get-WMIObject Win32_ComputerSystem |select Name3.$env:COMPUTERNAME4[net.dns]::GetHostAddresses('') | select -ExpandProperty IPAddressToString | select -index 5批处理常⽤命令及⽤法⼤全/thread-39-1-1.html批处理命令获取ip地址:powershell获取ip地址命令:[net.dns]::GetHostAddresses('') | select -ExpandProperty IPAddressToStringPS C:\Users\test001> [net.dns]::GetHostAddresses('') | select -ExpandProperty IPAddressToString | select -index 1 POWERshell命令讲解执⾏powershell脚本/powershell-invoking-files-and-scripts.htmlPowershell拥有⾃⼰的脚本,扩展名为“.ps1”powershell编写和运⾏脚本POWERshell命令讲解Powershell获取软件安装列表cmd获取软件列表python获取软件列表⼀键获取软硬件配置及管理员组bat常⽤命令————————————————————————————————————————————————————定义 set a=224输出 echo %a%显⽰⽂件内容 type a.txt2、添加默认驱动器c:\Users\Administrator>net use l: \\192.168.182.133\share "P@ssw0rd" /user:administrator命令成功完成。
Name Category Synopsis ---- -------- -------- % Alias ForEach-Object ? Alias Where-Object ac Alias Add-Content asnp Alias Add-PSSnapin cat Alias Get-Content cd Alias Set-Location chdir Alias Set-Location clc Alias Clear-Content clear Alias Clear-Host clhy Alias Clear-History cli Alias Clear-Item clp Alias Clear-ItemProperty cls Alias Clear-Host clv Alias Clear-Variable compare Alias Compare-Object copy Alias Copy-Item cp Alias Copy-Item cpi Alias Copy-Item cpp Alias Copy-ItemProperty cvpa Alias Convert-Path dbp Alias Disable-PSBreakpoint del Alias Remove-Item diff Alias Compare-Object dir Alias Get-ChildItem ebp Alias Enable-PSBreakpoint echo Alias Write-Output epal Alias Export-Alias epcsv Alias Export-Csv epsn Alias Export-PSSession erase Alias Remove-Item etsn Alias Enter-PSSession exsn Alias Exit-PSSession fc Alias Format-Custom fl Alias Format-List foreach Alias ForEach-Object ft Alias Format-Table fw Alias Format-Wide gal Alias Get-Alias gbp Alias Get-PSBreakpoint gc Alias Get-Content gci Alias Get-ChildItem gcm Alias Get-Command gcs Alias Get-PSCallStack gdr Alias Get-PSDrive ghy Alias Get-History gi Alias Get-Item gjb Alias Get-Job gl Alias Get-Location gm Alias Get-Member gmo Alias Get-Module gp Alias Get-ItemPropertygroup Alias Group-Objectgsn Alias Get-PSSession gsnp Alias Get-PSSnapin gsv Alias Get-Service gu Alias Get-Unique gv Alias Get-Variable gwmi Alias Get-WmiObject h Alias Get-History history Alias Get-History icm Alias Invoke-Command iex Alias Invoke-Expression ihy Alias Invoke-History ii Alias Invoke-Item ipal Alias Import-Alias ipcsv Alias Import-Csv ipmo Alias Import-Module ipsn Alias Import-PSSession ise Alias powershell_ise.exe iwmi Alias Invoke-WmiMethod kill Alias Stop-Process lp Alias Out-Printer ls Alias Get-ChildItem man Alias help md Alias mkdir measure Alias Measure-Object mi Alias Move-Item mount Alias New-PSDrive move Alias Move-Item mp Alias Move-ItemProperty mv Alias Move-Item nal Alias New-Alias ndr Alias New-PSDrive ni Alias New-Item nmo Alias New-Module nsn Alias New-PSSession nv Alias New-Variable ogv Alias Out-GridView oh Alias Out-Host popd Alias Pop-Location ps Alias Get-Process pushd Alias Push-Location pwd Alias Get-Location r Alias Invoke-History rbp Alias Remove-PSBreakpoint rcjb Alias Receive-Job rd Alias Remove-Item rdr Alias Remove-PSDrive ren Alias Rename-Item ri Alias Remove-Item rjb Alias Remove-Job rm Alias Remove-Item rmdir Alias Remove-Item rmo Alias Remove-Modulernp Alias Rename-ItemProperty rp Alias Remove-ItemProperty rsn Alias Remove-PSSession rsnp Alias Remove-PSSnapin rv Alias Remove-Variable rvpa Alias Resolve-Path rwmi Alias Remove-WmiObject sajb Alias Start-Job sal Alias Set-Alias saps Alias Start-Process sasv Alias Start-Service sbp Alias Set-PSBreakpoint sc Alias Set-Content select Alias Select-Object set Alias Set-Variable si Alias Set-Item sl Alias Set-Location sleep Alias Start-Sleep sort Alias Sort-Object sp Alias Set-ItemProperty spjb Alias Stop-Job spps Alias Stop-Process spsv Alias Stop-Service start Alias Start-Process sv Alias Set-Variable swmi Alias Set-WmiInstance tee Alias Tee-Object type Alias Get-Content where Alias Where-Object wjb Alias Wait-Job write Alias Write-Output Add-Computer Cmdlet 将本地计算机添加到域或工作组中。
powershell语法手册一、简介PowerShell是微软开发的一款强大的命令行脚本和配置环境。
它使用一种基于任务的脚本语言,使得系统管理员能够更高效地管理Windows环境。
PowerShell提供了丰富的命令和功能,使得用户可以自动化许多常见的系统管理任务。
二、基本语法命令结构PowerShell命令的基本结构如下:powershellcommand -Argument $value例如,要获取当前日期,可以使用:powershellGet-Date变量在PowerShell中,变量使用 $ 符号开头。
例如:powershell$variable = "Hello, World!"控制结构If语句:powershellIf ($condition) {# commands}For循环:powershellFor ($i = 0; $i -lt 10; $i++) {# commands}While循环:powershellWhile ($condition) {# commands}函数定义函数的方式如下:powershellFunction functionname {param (param1, param2)# commands}参数 PowerShell命令通常支持参数。
例如,Get-Process 命令可以带一个 -Name 参数来指定要获取的进程的名称。
使用参数的方式如下:powershellGet-Process -Name "notepad"管道管道操作符 | 可以用来将一个命令的输出传递给另一个命令作为输入。
例如:powershellGet-Process | Where-Object { $_.CPU -gt 50 } | Select-Object Name, CPU这个命令会列出CPU使用率超过50%的进程的名称和CPU使用率。
powershell简单命令
PowerShell是一种任务自动化和配置管理框架,它提供了一个命令行界面和脚本语言,类似于Unix shell。
以下是一些简单的PowerShell命令:
1. 获取当前目录的内容:
Get-ChildItem.
2. 切换目录:
Set-Location <目录路径>。
3. 显示当前目录的路径:
Get-Location.
4. 显示系统中正在运行的进程:
Get-Process.
5. 显示系统上安装的所有软件:
Get-WmiObject -Class Win32_Product.
6. 显示网络适配器信息:
Get-NetAdapter.
7. 显示系统服务的状态:
Get-Service.
8. 显示环境变量:
Get-ChildItem Env:
以上是一些PowerShell的简单命令,它们可以帮助你执行基本的文件和系统管理任务。
当然,PowerShell还有很多其他功能和命令,可以根据具体需求进行深入学习和使用。
PowerShell命令“Get-Service”的使用方法功能Get-Service是 PowerShell 中的一个命令行工具,用于查看和管理 Windows 服务。
它可以显示系统中所有服务的列表,以及每个服务的状态、启动类型和其他相关信息。
用法基本的命令格式如下:Get-Service [-Name] <String[]> [-ComputerName] <String[]> [-DisplayName]<String[]> [-ServiceName] <String[]> [<CommonParameters>]主要参数的作用-Name:指定要查询的服务名称。
-ComputerName:指定要查询的服务所在的主机名或 IP 地址。
-DisplayName:指定要查询的服务的显示名称。
-ServiceName:指定要查询的服务名称的空间分隔列表。
示例1. 获取所有服务的列表:Get-Service2. 获取名为“Network”的服务信息:Get-Service-Name Network3. 获取显示名称为“网络连接”的服务信息:Get-Service-DisplayName "网络连接"4. 获取远程计算机上的服务信息(假设你知道远程计算机的名称或IP地址):Get-Service-ComputerName "RemoteComputer"在使用这些示例时,请确保你正在查询的服务名称和显示名称是正确的。
如果你不确定服务的名称或显示名称,可以先使用Get-Service命令列出所有服务,然后从中找到所需的服务信息。
在操作远程计算机上的服务时,请确保你有足够的权限进行管理。
不正确的操作可能会导致系统不稳定或者服务中断。
PowerShell基本语法及常用命令Powershell常用命令1.Get-Command 得到Powshell所有命令2.Get-Process 获取所有迚程3.Set-Alias 给指定命令重命名如:Set-Alias aaa Get-Command4.Set-ExecutionPolicy remotesigned 设置powershell可直接执行脚本文件一般脚本文件以.ps1结尾执行脚本文件直接输入文件地址即可执行脚本文件中叧写命令即可5.Get-Help get-* 查询以get开头的命令Get-Help *service* Get-Help Get-Command 获取Get-Command命令的基本用法6.Get-Member 获取对象属性如: $var | Get-Memeber 访问$var属性直接$var.ToString()PS中的变量定义不需要定义或声明数据类型在变量前加"$"定义变量的规则-变量可以是数字$123-变量可以是字符串$abc-变量可以是特殊字符${@1b}内置的变量-$pshome-$home-$profile变量赋值: $var=123 $var="aaaaaa"取变量值: $var变量赋值方法:Set-Variable var 100取值方法: Get-Variable var清空值: Clear-Variable var删除变量Remove-Variable var取多个变量如var1 var2 var3地值: Get-Variable var*另一种赋值方法$var1="bbb" $var2="$var $var1" 结果$var2="aaaaaa bbb"$var2='$var $var1' 结果$var2="$var $var1"$date=Get-Date 获取当前时间$date.AddDays(3) 当前时间加3天排序用法Get-Process | Sort-Object ws 根据WS值由小到大排序Get-Process | Sort-Object | fl Get-Process | Sort-Object | Format-List 以列表形式显示数据比较运算符$var="abc"$var -like "*b*" 返回true$var -clike "*b*" 返回true函数使用案例:在一个脚本文件中有如下代码:$var1=10function one{"The Variable is $var1"}function two{$var1=20;one}onetwoone执行结果: The Variable is 10The Variable is 20The Variable is 10此示例表明,在函数中改变变量值并不影响实际值若需改变其值请看如下代码:$var1=10function one{"The Variable is $var1"}function two{$Script:var1=20;one}onetwoone执行结果: The Variable is 10The Variable is 20The Variable is 20 freach使用$var=1..6 #定义数组foreach($i in $var){$n++}Write-Host "there were $n record"if使用If ($a -gt 10){"$a is larger than 10"}ElseIf ($a -eq 10){"$a is exactly 10"}ElseIf ($a -ge 10){"$a is larger than or equal to 10" }Else{"$a is smaller than 10"}-eq 判断是否等于(equal)-lt 判断时候小于(less than)-gt 判断是否大于(greater than)-ge 判断是否大于或等于(greater or equal) -le 判断是否小于或等于(less or equal)-ne 判断是否不等于(no equal)。
powershell tree 指令在PowerShell 中,没有直接提供类似`tree` 命令的内置命令,但你可以使用PowerShell 的一些命令和功能来实现类似的目的。
以下是一些PowerShell 中可以用来显示目录结构的示例:### 1. 使用`Get-ChildItem` 和递归函数```powershellfunction Show-DirectoryTree {param ([string]$path = ".",[int]$indentLevel = 0)$indent = " " * $indentLevel$items = Get-ChildItem $pathforeach ($item in $items) {Write-Host "$indent$item"if ($item.PSIsContainer) {Show-DirectoryTree -path $item.FullName -indentLevel ($indentLevel + 2) }}}# 调用函数显示目录结构Show-DirectoryTree```此函数通过递归地调用自身,使用`Get-ChildItem` 获取目录内容,并显示目录结构。
### 2. 使用`tree` 命令(需要安装)如果你愿意使用外部命令,你可以安装`tree` 工具,并在PowerShell 中调用它。
请确保你已经安装了`tree` 工具,然后使用以下命令:```powershelltree```这将在当前目录下显示目录结构。
请注意,你需要先在系统中安装`tree` 工具。
### 3. 使用`Format-Table` 和递归```powershellfunction Format-DirectoryTree {param ([string]$path = ".",[int]$indentLevel = 0)$indent = " " * $indentLevel$items = Get-ChildItem $pathforeach ($item in $items) {$formattedItem = "$indent$item"if ($item.PSIsContainer) {Write-Host $formattedItemFormat-DirectoryTree -path $item.FullName -indentLevel ($indentLevel + 2) } else {Write-Host $formattedItem}}}# 调用函数显示目录结构Format-DirectoryTree```此函数类似于第一个示例,但使用`Format-Table` 将目录结构格式化输出。
windows powershell基本语法及常用命令摘要:I.引言- 介绍Windows PowerShell- 解释PowerShell的基本语法II.PowerShell基本语法- 命令提示符- 变量- 运算符- 条件语句- 循环语句III.常用命令- 文件和文件夹操作- 网络操作- 系统管理- 帮助和支持IV.高级功能- 脚本编写- 模块管理- 错误处理V.结论- 总结PowerShell的功能和优点- 鼓励读者学习和使用PowerShell正文:Windows PowerShell是一种强大的命令行工具,它提供了许多高级功能,可以帮助用户更高效地管理计算机和执行任务。
PowerShell的基本语法包括命令提示符、变量、运算符、条件语句和循环语句等,这些语法是编写PowerShell脚本的基础。
在PowerShell中,命令提示符是执行命令的地方,它类似于DOS命令提示符。
变量是存储数据的容器,可以使用它们来存储结果和值。
运算符用于执行各种算术和逻辑操作,例如加、减、乘、除和比较操作。
条件语句和循环语句用于控制程序的执行流程,可以根据特定条件执行不同的代码块。
PowerShell还提供了许多常用命令,用于执行各种任务。
例如,文件和文件夹操作命令可以帮助用户管理文件和文件夹,包括创建、删除、重命名和移动文件和文件夹。
网络操作命令可以帮助用户管理网络连接和资源,例如创建、删除和修改网络共享。
系统管理命令可以帮助用户管理计算机的硬件和软件资源,例如查看计算机配置、安装和卸载软件。
帮助和支持命令可以帮助用户查找和使用PowerShell的帮助文档和社区支持。
除了基本语法和常用命令外,PowerShell还提供了许多高级功能,例如脚本编写、模块管理和错误处理。
脚本编写允许用户创建自定义脚本,以执行复杂任务和自动化任务。
模块管理允许用户管理PowerShell模块,这些模块可以提供额外的功能和命令。
PowerShell命令[PowerShell]#别名ac = Add-Contentasnp = Add-PSSnapinclc = Clear-Contentcli = Clear-Itemclp = Clear-ItemPropertyclv = Clear-Variablecpi = Copy-Itemcpp = Copy-ItemPropertycvpa = Convert-Pathdiff = Compare-Objectepal = Export-Aliasepcsv = Export-Csvfc = Format-Customfl = Format-Listforeach = ForEach-Object% = ForEach-Objectft = Format-Tablefw = Format-Widegal = Get-Aliasgc = Get-Contentgci = Get-ChildItemgcm = Get-Commandgdr = Get-PSDriveghy = Get-Historygi = Get-Itemgl = Get-Locationgm = Get-Membergp = Get-ItemPropertygps = Get-Processgroup = Group-Objectgsv = Get-Servicegsnp = Get-PSSnapingu = Get-Uniquegv = Get-Variablegwmi = Get-WmiObjectiex = Invoke-Expressionihy = Invoke-Historyii = Invoke-Itemipal = Import-Aliasipcsv = Import-Csvmi = Move-Itemmp = Move-ItemPropertynal = New-Aliasndr = New-PSDriveni = New-Itemnv = New-Variableoh = Out-Hostrdr = Remove-PSDriveri = Remove-Itemrni = Rename-Itemrnp = Rename-ItemPropertyrp = Remove-ItemPropertyrsnp = Remove-PSSnapinrv = Remove-Variablervpa = Resolve-Pathsal = Set-Aliassasv = Start-Servicesc = Set-Contentselect = Select-Objectsi = Set-Itemsl = Set-Location sleep = Start-Sleep sort = Sort-Objectsp = Set-ItemProperty spps = Stop-Process spsv = Stop-Service sv = Set-Variabletee = Tee-Object where = Where-Object ? = Where-Object write = Write-Output cat = Get-Contentcd = Set-Location clear = Clear-Hostcp = Copy-Itemh = Get-History history = Get-History kill = Stop-Processlp = Out-Printerls = Get-ChildItem mount = New-PSDrive mv = Move-Itempopd = Pop-Location ps = Get-Process pushd = Push-Location pwd = Get-Locationr = Invoke-Historyrm = Remove-Item rmdir = Remove-Item echo = Write-Output cls = Clear-Host chdir = Set-Location copy = Copy-Itemdel = Remove-Itemdir = Get-ChildItem erase = Remove-Item move = Move-Itemrd = Remove-Itemren = Rename-Item set = Set-Variable type = Get-Content#PSDrivealiascertenvfunctionhkcuhklmvariable#获取帮助help get*help *processhelp dirhelp dir -fullhelp dir -detailedhelp dir -exampledir -?#转义序列`0 //空值`a //Beep`b //退格`f //换页`n //新⾏`r //回车`t //制表符`v //垂直引号`` // "`"#数字常量1kb // 10241mb1gb1e3 // 10000xFFFF // 65535#编辑脚本,推荐使⽤PrimalScript的最新版本,⾮常强⼤#设置脚本安全策略set-executionpolicy Restricted #默认set-executionpolicy AllSigned #部署set-executionpolicy RemoteSigned #开发set-executionpolicy Unrestricted #不推荐#执⾏脚本必须带路径./myScript.ps1#获取基于⽤户名和密码的凭据对象$cert = get-credential#对脚本签名$cert = Get-PfxCertificate C:\Test\Mysign.pfxSet-AuthenticodeSignature myScript.ps1 -cert $cert#操作系统gwmi win32_operatingsystem#⾃动变量$Args #传递进函数的参数$_ #通过管道传⼊的对象$input #通过管道传⼊的对象集合$$ #前⼀命令⾏的最后⼀个标记$? #上⼀命令的布尔状态$^ #前⼀命令⾏的第⼀个标记$Matches #使⽤ –match 运算符找到的匹配项的哈希表$Error[0] #前⼀次错误$Home #⽤户的主⽬录$Host #引⽤宿主 POWERSHELL 语⾔的应⽤程序$LastExitCode #上⼀程序或脚本的退出代码$PSHome #Windows PowerShell 的安装位置$profile #标准配置⽂件(可能不存在)$StackTrace #Windows PowerShell 捕获的上⼀异常#类型空类型[void]数值类型[byte] typeof(byte)[decimal] typeof(decimal)[double] typeof(double)[float] typeof(float)[int] typeof(int)[long] typeof(long)[single] typeof(float)字符类型[char] typeof(char)[string] typeof(string)布尔类型[bool] typeof(bool)集合类型[array] typeof(System.Array)typeof(System.Object[])[hashtable] typeof(System.Collections.Hashtable) 其它[psobject] typeof(System.Management.Automation.PSObject)[ref] typeof(System.Management.Automation.PSReference)[regex] typeof(System.Text.RegularExpressions.Regex)[scriptblock] typeof(System.Management.Automation.ScriptBlock)[switch] typeof(System.Management.Automation.SwitchParameter)[type] typeof(System.Type)[wmi] typeof(System.Management.ManagementObject)[wmiclass] typeof(System.Management.ManagementClass)[wmisearcher] typeof(System.Management.ManagementObjectSearcher)[xml] typeof(System.Xml.XmlDocument)example:#[void][void] $var #可以阻⽌$var输出#[xml]$var = [xml] "onetwo3"$var.top$var.top.a$var.top.a = "13"#⾃定义函数function writeln([string] $str) { echo $str }function writeln([string] $str) { Begin {echo "Begin"} Process {echo $str} End {echo "End"} } function writeln { param ([string] $str = $(throw "missing parameter")); echo $str } ${function:writeln} = { param ([string] $str = $(throw "missing parameter")); echo $str }#⽂本⽂件读写${C:\test.txt} = "Hello`r`n"${C:\test.txt} += "-----------------"$Line1 = ${C:\test.txt}[0]# $null$var = $null #删除$vardir > $null$null = dir#Invoke$method = "ToUpper""abc".$method.Invoke()#布尔值$true$false#where, select等的⽤法cd c:\dir | where {$_.Name -eq "WINDOWS"} | select Length,Namedir | ? {$_.Name -eq "WINDOWS"}# 列出字符串对象"str"的所有属性与⽅法"str" | gm#强制类型变量[Boolean] $condition = 0[string] $str = "hello"#数组$array = 1,2,3,4,5,6,7,8$array = @(1,2,3,4,5,6,7,8)$array[-1] #最后⼀个元素$array[0..4]$array[-1..-8] #倒序#哈希表$hash = @{"Name"="Icebird"; "Job"="Engineer"}#如何取得⽂本的⾏数(type C:\test.txt | measure-object).Count#从控制台读取⼀⾏输⼊$var = Read-Host#获取环境变量$path = $env:Path#读取注册表$a = (gp "hklm:\\Software\Microsoft\Windows\CurrentVersion").ProductId #⽐较和运算-like "file.doc" -like "file.*"-notlike-contains 1,2,3 -contains 1-notcontains-----------------------------------eq = (忽略⼤⼩写)-ieq = (忽略⼤⼩写)-ceq = (不忽略⼤⼩写)-ne !=-gt >-lt <-ge >=-le <=以上操作符也可⽤于对数组操作:1,2,3,5,3,2 -lt 3-----------------------------------and-or-not! 等价于-not-xor% 模运算* 可⽤于字符串重复: "-" * 80#位操作-band-bor-bnot-bxor#特殊操作$a = "Hat"$a -replace "a","o"$a -is [string]$a = 1 -as [string]$b = @(1..5)"{0:d}" -f (get-date)"{0:yyyy-MM-dd}" -f (get-date)#格式化$a = 123456789.456789$a.ToString("F4")"{0:F4}" -f $a"{0,-20:F4}{1}" -f $a,0"{0,20:F4}" -f $a"{0:x}" -f 100000"{0:X}" -f 100000#正则表达式$regex = [regex]"He"$str = "Hello, Hello"$isMatch = $str -match $regex$isMatch = $regex.ismatch($str)$matches = $regex.matches($str)#双引号与单引号$a = 1;"$a"会输出1'$a'会输出$a# & 与 ..{$var = 1} #看作include&{$var = 1} #看作call&"dir" #意味着函数名之类的可以当作参数传⼊#foreachforeach ($file in dir) { $ }dir | % { $_.Name }#forfor ($i = 1; $i -lt 5; $i++) {echo $i}#while$i = 0while ($i -lt 4) { $i++; $i }#do...while$i = 10do {$i--; $i} while ($i -lt 5)#do...until$i = 10do {$i--; $i} until ($i -lt 5)#if...else[if]$obj = "Hello"if ($obj -is [string]) { "ISSTRING" }if ($obj -is [string]) { "ISSTRING" } else { "ISNOTSTRING" }if ($obj -is [string]) { "ISSTRING" } elseif ($obj -is [int]) { "ISINTEGER" } #switchswitch (1,2,3) { 1 {"a"} 2 {"b"} 3 {"c"} default {"?"} }switch (1) { "a" {"China"} "b" {"Japan"} "c" {"c"} default {"???"} }#switch -regex$var = "abcdefg"switch -regex($var) {"^\w+$" {echo $_" is a word"}"^\d+$" {echo $_" is a number"}"^\s+$" {echo $_" is a space"}default {echo "?"}}#switch -casesensitive#switch -wildcard#switch -extract ?怎么⽤#switch -file ?怎么⽤#抛出错误&捕获异常throw "Error"raised "Exception"trap{write-host "Error: " $_.Exception.Message#$_.TargetObject#$_.CategoryInfo#$_.FullyQualifiedErrorID#$_.ErrorDetails#$_.InvocationInfocontinue#break#return}#输出格式化Format-ListFormat-TableFormat-WideFormat-Customdir | format-table -groupby Modedir | sort Name -descdir | sort Name -desc | select Name,Length,Mode | export-csv C:\dir.csv dir | sort Name -desc | select Name,Length,Mode | export-clixml C:\dir.csv dir | convertto-html#使⽤.NET的对象$webclient = New-Object .WebClient$webclient.Encoding = [System.Text.Encoding]::UTF8$url = ""$data = [string]$webclient.downloadstring($url)#使⽤COM对象$spVoice = new-object -com "SAPI.spvoice"$spVoice.Speak("Hello, I am Icebird.")。
CommandType Name Definition-------------------------Alias%ForEach-ObjectAlias?Where-ObjectFunction A:Set-Location A:Alias ac Add-ContentCmdlet Add-Computer Add-Computer [-DomainName] <... Cmdlet Add-Content Add-Content [-Path] <String[... Cmdlet Add-History Add-History [[-InputObject] ... Cmdlet Add-Member Add-Member [-MemberType] <PS... Cmdlet Add-PSSnapin Add-PSSnapin [-Name] <String... Cmdlet Add-Type Add-Type [-TypeDefinition] <... Alias asnp Add-PSSnapInFunction B:Set-Location B:Function C:Set-Location C:Alias cat Get-ContentAlias cd Set-LocationFunction cd..Set-Location ..Function cd\Set-Location \Alias chdir Set-LocationCmdlet Checkpoint-Computer Checkpoint-Computer [-Descri... Alias clc Clear-ContentAlias clear Clear-HostCmdlet Clear-Content Clear-Content [-Path] <Strin... Cmdlet Clear-EventLog Clear-EventLog [-LogName] <S... Cmdlet Clear-History Clear-History [[-Id] <Int32[... Function Clear-Host$space = New-Object System.M... Cmdlet Clear-Item Clear-Item [-Path] <String[]... Cmdlet Clear-ItemProperty Clear-ItemProperty [-Path] <... Cmdlet Clear-Variable Clear-Variable [-Name] <Stri... Alias clhy Clear-HistoryAlias cli Clear-ItemAlias clp Clear-ItemPropertyAlias cls Clear-HostAlias clv Clear-VariableAlias compare Compare-ObjectCmdlet Compare-Object Compare-Object [-ReferenceOb... Cmdlet Complete-Transaction Complete-Transaction [-Verbo... Cmdlet Connect-WSMan Connect-WSMan [[-ComputerNam... Cmdlet ConvertFrom-Csv ConvertFrom-Csv [-InputObjec... Cmdlet ConvertFrom-SecureString ConvertFrom-SecureString [-S... Cmdlet ConvertFrom-StringData ConvertFrom-StringData [-Str... Cmdlet Convert-Path Convert-Path [-Path] <String... Cmdlet ConvertTo-Csv ConvertTo-Csv [-InputObject]... Cmdlet ConvertTo-Html ConvertTo-Html [[-Property] ... Cmdlet ConvertTo-SecureString ConvertTo-SecureString [-Str... Cmdlet ConvertTo-Xml ConvertTo-Xml [-InputObject]... Alias copy Copy-ItemCmdlet Copy-Item Copy-Item [-Path] <String[]>... Cmdlet Copy-ItemProperty Copy-ItemProperty [-Path] <S... Alias cp Copy-ItemAlias cpi Copy-ItemAlias cpp Copy-ItemPropertyAlias cvpa Convert-PathFunction D:Set-Location D:Alias dbp Disable-PSBreakpointCmdlet Debug-Process Debug-Process [-Name] <Strin... Alias del Remove-ItemAlias diff Compare-ObjectAlias dir Get-ChildItemCmdlet Disable-ComputerRestore Disable-ComputerRestore [-Dr... Cmdlet Disable-PSBreakpoint Disable-PSBreakpoint [-Break... Function Disable-PSRemoting...Cmdlet Disable-PSSessionConfiguration Disable-PSSessionConfigurati... Cmdlet Disable-WSManCredSSP Disable-WSManCredSSP [-Role]... Cmdlet Disconnect-WSMan Disconnect-WSMan [[-Computer... Function E:Set-Location E:Alias ebp Enable-PSBreakpointAlias echo Write-OutputCmdlet Enable-ComputerRestore Enable-ComputerRestore [-Dri... Cmdlet Enable-PSBreakpoint Enable-PSBreakpoint [-Id] <I... Cmdlet Enable-PSRemoting Enable-PSRemoting [-Force] [... Cmdlet Enable-PSSessionConfiguration Enable-PSSessionConfiguratio... Cmdlet Enable-WSManCredSSP Enable-WSManCredSSP [-Role] ... Cmdlet Enter-PSSession Enter-PSSession [-ComputerNa... Alias epal Export-AliasAlias epcsv Export-CsvAlias epsn Export-PSSessionAlias erase Remove-ItemAlias etsn Enter-PSSessionCmdlet Exit-PSSession Exit-PSSession [-Verbose] [-... Cmdlet Export-Alias Export-Alias [-Path] <String... Cmdlet Export-Clixml Export-Clixml [-Path] <Strin... Cmdlet Export-Console Export-Console [[-Path] <Str... Cmdlet Export-Counter Export-Counter [-Path] <Stri... Cmdlet Export-Csv Export-Csv [-Path] <String> ... Cmdlet Export-FormatData Export-FormatData [-InputObj... Cmdlet Export-ModuleMember Export-ModuleMember [[-Funct... Cmdlet Export-PSSession Export-PSSession [-Session] ... Alias exsn Exit-PSSessionFunction F:Set-Location F:Alias fc Format-CustomAlias fl Format-ListAlias foreach ForEach-ObjectCmdlet ForEach-Object ForEach-Object [-Process] <S... Cmdlet Format-Custom Format-Custom [[-Property] <... Cmdlet Format-List Format-List [[-Property] <Ob... Cmdlet Format-Table Format-Table [[-Property] <O... Cmdlet Format-Wide Format-Wide [[-Property] <Ob... Alias ft Format-TableAlias fw Format-WideFunction G:Set-Location G:Alias gal Get-AliasAlias gbp Get-PSBreakpointAlias gc Get-ContentAlias gci Get-ChildItemAlias gcm Get-CommandAlias gcs Get-PSCallStackAlias gdr Get-PSDriveCmdlet Get-Acl Get-Acl [[-Path] <String[]>]... Cmdlet Get-Alias Get-Alias [[-Name] <String[]... Cmdlet Get-AuthenticodeSignature Get-AuthenticodeSignature [-... Cmdlet Get-ChildItem Get-ChildItem [[-Path] <Stri... Cmdlet Get-Command Get-Command [[-ArgumentList]... Cmdlet Get-ComputerRestorePoint Get-ComputerRestorePoint [[-... Cmdlet Get-Content Get-Content [-Path] <String[... Cmdlet Get-Counter Get-Counter [[-Counter] <Str... Cmdlet Get-Credential Get-Credential [-Credential]... Cmdlet Get-Culture Get-Culture [-Verbose] [-Deb... Cmdlet Get-Date Get-Date [[-Date] <DateTime>... Cmdlet Get-Event Get-Event [[-SourceIdentifie... Cmdlet Get-EventLog Get-EventLog [-LogName] <Str... Cmdlet Get-EventSubscriber Get-EventSubscriber [[-Sourc... Cmdlet Get-ExecutionPolicy Get-ExecutionPolicy [[-Scope... Cmdlet Get-FormatData Get-FormatData [[-TypeName] ... Cmdlet Get-Help Get-Help [[-Name] <String>] ... Cmdlet Get-History Get-History [[-Id] <Int64[]>... Cmdlet Get-Host Get-Host [-Verbose] [-Debug]... Cmdlet Get-HotFix Get-HotFix [[-Id] <String[]>... Cmdlet Get-Item Get-Item [-Path] <String[]> ... Cmdlet Get-ItemProperty Get-ItemProperty [-Path] <St... Cmdlet Get-Job Get-Job [[-Id] <Int32[]>] [-... Cmdlet Get-Location Get-Location [-PSProvider <S... Cmdlet Get-Member Get-Member [[-Name] <String[... Cmdlet Get-Module Get-Module [[-Name] <String[... Cmdlet Get-PfxCertificate Get-PfxCertificate [-FilePat... Cmdlet Get-Process Get-Process [[-Name] <String... Cmdlet Get-PSBreakpoint Get-PSBreakpoint [[-Script] ... Cmdlet Get-PSCallStack Get-PSCallStack [-Verbose] [... Cmdlet Get-PSDrive Get-PSDrive [[-Name] <String... Cmdlet Get-PSProvider Get-PSProvider [[-PSProvider... Cmdlet Get-PSSession Get-PSSession [[-ComputerNam... Cmdlet Get-PSSessionConfiguration Get-PSSessionConfiguration [... Cmdlet Get-PSSnapin Get-PSSnapin [[-Name] <Strin... Cmdlet Get-Random Get-Random [[-Maximum] <Obje... Cmdlet Get-Service Get-Service [[-Name] <String... Cmdlet Get-TraceSource Get-TraceSource [[-Name] <St... Cmdlet Get-Transaction Get-Transaction [-Verbose] [... Cmdlet Get-UICulture Get-UICulture [-Verbose] [-D... Cmdlet Get-Unique Get-Unique [-InputObject <PS... Cmdlet Get-Variable Get-Variable [[-Name] <Strin... Function Get-Verb...Cmdlet Get-WinEvent Get-WinEvent [[-LogName] <St... Cmdlet Get-WmiObject Get-WmiObject [-Class] <Stri... Cmdlet Get-WSManCredSSP Get-WSManCredSSP [-Verbose] ... Cmdlet Get-WSManInstance Get-WSManInstance [-Resource... Alias ghy Get-HistoryAlias gi Get-ItemAlias gjb Get-JobAlias gl Get-LocationAlias gm Get-MemberAlias gmo Get-ModuleAlias gp Get-ItemPropertyAlias gps Get-ProcessAlias group Group-ObjectCmdlet Group-Object Group-Object [[-Property] <O... Alias gsn Get-PSSessionAlias gsnp Get-PSSnapInAlias gsv Get-ServiceAlias gu Get-UniqueAlias gv Get-VariableAlias gwmi Get-WmiObjectAlias h Get-HistoryFunction H:Set-Location H:Function help...Alias history Get-HistoryFunction I:Set-Location I:Alias icm Invoke-CommandAlias iex Invoke-ExpressionAlias ihy Invoke-HistoryAlias ii Invoke-ItemCmdlet Import-Alias Import-Alias [-Path] <String... Cmdlet Import-Clixml Import-Clixml [-Path] <Strin... Cmdlet Import-Counter Import-Counter [-Path] <Stri... Cmdlet Import-Csv Import-Csv [-Path] <String[]... Cmdlet Import-LocalizedData Import-LocalizedData [-Bindi... Cmdlet Import-Module Import-Module [-Name] <Strin... Cmdlet Import-PSSession Import-PSSession [-Session] ... Function ImportSystemModules...Cmdlet Invoke-Command Invoke-Command [-ScriptBlock... Cmdlet Invoke-Expression Invoke-Expression [-Command]... Cmdlet Invoke-History Invoke-History [[-Id] <Strin... Cmdlet Invoke-Item Invoke-Item [-Path] <String[... Cmdlet Invoke-WmiMethod Invoke-WmiMethod [-Class] <S... Cmdlet Invoke-WSManAction Invoke-WSManAction [-Resourc... Alias ipal Import-AliasAlias ipcsv Import-CsvAlias ipmo Import-ModuleAlias ipsn Import-PSSessionAlias ise powershell_ise.exeAlias iwmi Invoke-WMIMethodFunction J:Set-Location J:Cmdlet Join-Path Join-Path [-Path] <String[]>... Function K:Set-Location K:Alias kill Stop-ProcessFunction L:Set-Location L:Cmdlet Limit-EventLog Limit-EventLog [-LogName] <S... Alias lp Out-PrinterAlias ls Get-ChildItemFunction M:Set-Location M:Alias man helpAlias md mkdirAlias measure Measure-ObjectCmdlet Measure-Command Measure-Command [-Expression... Cmdlet Measure-Object Measure-Object [[-Property] ... Alias mi Move-ItemFunction mkdir...Function more param([string[]]$paths)... Alias mount New-PSDriveAlias move Move-ItemCmdlet Move-Item Move-Item [-Path] <String[]>... Cmdlet Move-ItemProperty Move-ItemProperty [-Path] <S... Alias mp Move-ItemPropertyAlias mv Move-ItemFunction N:Set-Location N:Alias nal New-AliasAlias ndr New-PSDriveCmdlet New-Alias New-Alias [-Name] <String> [... Cmdlet New-Event New-Event [-SourceIdentifier... Cmdlet New-EventLog New-EventLog [-LogName] <Str... Cmdlet New-Item New-Item [-Path] <String[]> ... Cmdlet New-ItemProperty New-ItemProperty [-Path] <St... Cmdlet New-Module New-Module [-ScriptBlock] <S... Cmdlet New-ModuleManifest New-ModuleManifest [-Path] <... Cmdlet New-Object New-Object [-TypeName] <Stri... Cmdlet New-PSDrive New-PSDrive [-Name] <String>... Cmdlet New-PSSession New-PSSession [[-ComputerNam... Cmdlet New-PSSessionOption New-PSSessionOption [-Maximu... Cmdlet New-Service New-Service [-Name] <String>... Cmdlet New-TimeSpan New-TimeSpan [[-Start] <Date... Cmdlet New-Variable New-Variable [-Name] <String... Cmdlet New-WebServiceProxy New-WebServiceProxy [-Uri] <... Cmdlet New-WSManInstance New-WSManInstance [-Resource... Cmdlet New-WSManSessionOption New-WSManSessionOption [-Pro... Alias ni New-ItemAlias nmo New-ModuleAlias nsn New-PSSessionAlias nv New-VariableFunction O:Set-Location O:Alias ogv Out-GridViewAlias oh Out-HostCmdlet Out-Default Out-Default [-InputObject <P... Cmdlet Out-File Out-File [-FilePath] <String... Cmdlet Out-GridView Out-GridView [-InputObject <... Cmdlet Out-Host Out-Host [-Paging] [-InputOb... Cmdlet Out-Null Out-Null [-InputObject <PSOb... Cmdlet Out-Printer Out-Printer [[-Name] <String... Cmdlet Out-String Out-String [-Stream] [-Width... Function P:Set-Location P:Alias popd Pop-LocationCmdlet Pop-Location Pop-Location [-PassThru] [-S... Function prompt$(if (test-path variable:/PS... Alias ps Get-ProcessAlias pushd Push-LocationCmdlet Push-Location Push-Location [[-Path] <Stri... Alias pwd Get-LocationFunction Q:Set-Location Q:Alias r Invoke-HistoryFunction R:Set-Location R:Alias rbp Remove-PSBreakpointAlias rcjb Receive-JobAlias rd Remove-ItemAlias rdr Remove-PSDriveCmdlet Read-Host Read-Host [[-Prompt] <Object... Cmdlet Receive-Job Receive-Job [-Job] <Job[]> [... Cmdlet Register-EngineEvent Register-EngineEvent [-Sourc... Cmdlet Register-ObjectEvent Register-ObjectEvent [-Input... Cmdlet Register-PSSessionConfiguration Register-PSSessionConfigurat... Cmdlet Register-WmiEvent Register-WmiEvent [-Class] <... Cmdlet Remove-Computer Remove-Computer [[-Credentia... Cmdlet Remove-Event Remove-Event [-SourceIdentif... Cmdlet Remove-EventLog Remove-EventLog [-LogName] <... Cmdlet Remove-Item Remove-Item [-Path] <String[... Cmdlet Remove-ItemProperty Remove-ItemProperty [-Path] ... Cmdlet Remove-Job Remove-Job [-Id] <Int32[]> [... Cmdlet Remove-Module Remove-Module [-Name] <Strin... Cmdlet Remove-PSBreakpoint Remove-PSBreakpoint [-Breakp... Cmdlet Remove-PSDrive Remove-PSDrive [-Name] <Stri... Cmdlet Remove-PSSession Remove-PSSession [-Id] <Int3... Cmdlet Remove-PSSnapin Remove-PSSnapin [-Name] <Str... Cmdlet Remove-Variable Remove-Variable [-Name] <Str... Cmdlet Remove-WmiObject Remove-WmiObject [-Class] <S... Cmdlet Remove-WSManInstance Remove-WSManInstance [-Resou... Alias ren Rename-ItemCmdlet Rename-Item Rename-Item [-Path] <String>... Cmdlet Rename-ItemProperty Rename-ItemProperty [-Path] ... Cmdlet Reset-ComputerMachinePassword Reset-ComputerMachinePasswor... Cmdlet Resolve-Path Resolve-Path [-Path] <String... Cmdlet Restart-Computer Restart-Computer [[-Computer... Cmdlet Restart-Service Restart-Service [-Name] <Str... Cmdlet Restore-Computer Restore-Computer [-RestorePo... Cmdlet Resume-Service Resume-Service [-Name] <Stri... Alias ri Remove-ItemAlias rjb Remove-JobAlias rm Remove-ItemAlias rmdir Remove-ItemAlias rmo Remove-ModuleAlias rni Rename-ItemAlias rnp Rename-ItemPropertyAlias rp Remove-ItemPropertyAlias rsn Remove-PSSessionAlias rsnp Remove-PSSnapinAlias rv Remove-VariableAlias rvpa Resolve-PathAlias rwmi Remove-WMIObjectFunction S:Set-Location S:Alias sajb Start-JobAlias sal Set-AliasAlias saps Start-ProcessAlias sasv Start-ServiceAlias sbp Set-PSBreakpointAlias sc Set-ContentAlias select Select-ObjectCmdlet Select-Object Select-Object [[-Property] <...Cmdlet Select-String Select-String [-Pattern] <St... Cmdlet Select-Xml Select-Xml [-XPath] <String>... Cmdlet Send-MailMessage Send-MailMessage [-To] <Stri... Alias set Set-VariableCmdlet Set-Acl Set-Acl [-Path] <String[]> [... Cmdlet Set-Alias Set-Alias [-Name] <String> [... Cmdlet Set-AuthenticodeSignature Set-AuthenticodeSignature [-... Cmdlet Set-Content Set-Content [-Path] <String[... Cmdlet Set-Date Set-Date [-Date] <DateTime> ... Cmdlet Set-ExecutionPolicy Set-ExecutionPolicy [-Execut... Cmdlet Set-Item Set-Item [-Path] <String[]> ... Cmdlet Set-ItemProperty Set-ItemProperty [-Path] <St... Cmdlet Set-Location Set-Location [[-Path] <Strin... Cmdlet Set-PSBreakpoint Set-PSBreakpoint [-Script] <... Cmdlet Set-PSDebug Set-PSDebug [-Trace <Int32>]... Cmdlet Set-PSSessionConfiguration Set-PSSessionConfiguration [... Cmdlet Set-Service Set-Service [-Name] <String>... Cmdlet Set-StrictMode Set-StrictMode -Version <Ver... Cmdlet Set-TraceSource Set-TraceSource [-Name] <Str... Cmdlet Set-Variable Set-Variable [-Name] <String... Cmdlet Set-WmiInstance Set-WmiInstance [-Class] <St... Cmdlet Set-WSManInstance Set-WSManInstance [-Resource... Cmdlet Set-WSManQuickConfig Set-WSManQuickConfig [-UseSS... Cmdlet Show-EventLog Show-EventLog [[-ComputerNam... Alias si Set-ItemAlias sl Set-LocationAlias sleep Start-SleepAlias sort Sort-ObjectCmdlet Sort-Object Sort-Object [[-Property] <Ob... Alias sp Set-ItemPropertyAlias spjb Stop-JobCmdlet Split-Path Split-Path [-Path] <String[]... Alias spps Stop-ProcessAlias spsv Stop-ServiceAlias start Start-ProcessCmdlet Start-Job Start-Job [-ScriptBlock] <Sc... Cmdlet Start-Process Start-Process [-FilePath] <S... Cmdlet Start-Service Start-Service [-Name] <Strin... Cmdlet Start-Sleep Start-Sleep [-Seconds] <Int3... Cmdlet Start-Transaction Start-Transaction [-Timeout ... Cmdlet Start-Transcript Start-Transcript [[-Path] <S... Cmdlet Stop-Computer Stop-Computer [[-ComputerNam... Cmdlet Stop-Job Stop-Job [-Id] <Int32[]> [-P... Cmdlet Stop-Process Stop-Process [-Id] <Int32[]>... Cmdlet Stop-Service Stop-Service [-Name] <String... Cmdlet Stop-Transcript Stop-Transcript [-Verbose] [... Cmdlet Suspend-Service Suspend-Service [-Name] <Str... Alias sv Set-VariableAlias swmi Set-WMIInstanceFunction T:Set-Location T:Function TabExpansion...Alias tee Tee-ObjectCmdlet Tee-Object Tee-Object [-FilePath] <Stri... Cmdlet Test-ComputerSecureChannel Test-ComputerSecureChannel [...Cmdlet Test-Connection Test-Connection [-ComputerNa... Cmdlet Test-ModuleManifest Test-ModuleManifest [-Path] ... Cmdlet Test-Path Test-Path [-Path] <String[]>... Cmdlet Test-WSMan Test-WSMan [[-ComputerName] ... Cmdlet Trace-Command Trace-Command [-Name] <Strin... Alias type Get-ContentFunction U:Set-Location U:Cmdlet Undo-Transaction Undo-Transaction [-Verbose] ... Cmdlet Unregister-Event Unregister-Event [-SourceIde... Cmdlet Unregister-PSSessionConfigur...Unregister-PSSessionConfigur... Cmdlet Update-FormatData Update-FormatData [[-AppendP... Cmdlet Update-List Update-List [[-Property] <St... Cmdlet Update-TypeData Update-TypeData [[-AppendPat... Cmdlet Use-Transaction Use-Transaction [-Transacted... Function V:Set-Location V:Function W:Set-Location W:Cmdlet Wait-Event Wait-Event [[-SourceIdentifi... Cmdlet Wait-Job Wait-Job [-Id] <Int32[]> [-A... Cmdlet Wait-Process Wait-Process [-Name] <String... Alias where Where-ObjectCmdlet Where-Object Where-Object [-FilterScript]... Alias wjb Wait-JobAlias write Write-OutputCmdlet Write-Debug Write-Debug [-Message] <Stri... Cmdlet Write-Error Write-Error [-Message] <Stri... Cmdlet Write-EventLog Write-EventLog [-LogName] <S... Cmdlet Write-Host Write-Host [[-Object] <Objec... Cmdlet Write-Output Write-Output [-InputObject] ... Cmdlet Write-Progress Write-Progress [-Activity] <... Cmdlet Write-Verbose Write-Verbose [-Message] <St... Cmdlet Write-Warning Write-Warning [-Message] <St... Function X:Set-Location X:Function Y:Set-Location Y:Function Z:Set-Location Z:。