powershell
2013-11-23 23:57
513 查看
http://technet.microsoft.com/zh-cn/scriptcenter/powershell.aspx
$Host.Version
1..15 | % {Write-Host -ForegroundColor $_ "Hello"}
Get-Process | Stop-Process -WhatIf
Get-Process | Stop-Process -Confirm
Get-EventLog -LogName application -Newest 1
Get-Verb
Get-Variable
Get-Command
Get-Help
Update-Help
Get-Help Get-Process -Examples
Dir,Cls,Md,Rd,Ls,Get-Process,Get-Service,Get-EventLog,Get-Lost?,Get-Help
cat,可以用文本文件作为输入参数
Get-Process notepad | Stop-Process
Get-History(h), r 23再次执行第23条历史指令
重定向:>,>>
读文件:Get-Content(gc,cat,type)
添加内容:Add-Content(ac)
删除文件:Remove-Item(del,erase)
dir | where { $_.Mode -match '^d' }
Get-ChildItem . | where { $_.LastWriteTime -gt [datetime]"3/3/2013" }
New-Item Alias:myalias -Value gps
New-Item function:myfunction -Value{Get-Process -name $input}, "svchost" | myfunction
New-Item env:myenv -Value "myenv", Get-Item Env:\myenv
New-Item variable:myvar -Value "myVar", Get-Item Variable:\myvar
Variable:Clear-Variable,Get-Variable,New-Variable,Remove-Variable,Set-Variable
Alias: Expor-Alias,Get-Alias,Import-Alias,New-Alias,Set-Alias
Get-Command -Noun Variable,Get-Variable $ | Format-List
Get-Command -Noun alias
$Host.Version
1..15 | % {Write-Host -ForegroundColor $_ "Hello"}
Get-Process | Stop-Process -WhatIf
Get-Process | Stop-Process -Confirm
Get-EventLog -LogName application -Newest 1
Get-Verb
Get-Variable
Get-Command
Get-Help
Update-Help
Get-Help Get-Process -Examples
Dir,Cls,Md,Rd,Ls,Get-Process,Get-Service,Get-EventLog,Get-Lost?,Get-Help
cat,可以用文本文件作为输入参数
Get-Process notepad | Stop-Process
Get-History(h), r 23再次执行第23条历史指令
重定向:>,>>
读文件:Get-Content(gc,cat,type)
添加内容:Add-Content(ac)
删除文件:Remove-Item(del,erase)
dir | where { $_.Mode -match '^d' }
Get-ChildItem . | where { $_.LastWriteTime -gt [datetime]"3/3/2013" }
New-Item Alias:myalias -Value gps
New-Item function:myfunction -Value{Get-Process -name $input}, "svchost" | myfunction
New-Item env:myenv -Value "myenv", Get-Item Env:\myenv
New-Item variable:myvar -Value "myVar", Get-Item Variable:\myvar
Variable:Clear-Variable,Get-Variable,New-Variable,Remove-Variable,Set-Variable
Alias: Expor-Alias,Get-Alias,Import-Alias,New-Alias,Set-Alias
Get-Command -Noun Variable,Get-Variable $ | Format-List
Get-Command -Noun alias
相关文章推荐
- 《Linux Shell Scripting Cookbook》Linux常用命令笔记(一)
- linux shell 编程
- Powershell一些概念的理解:管道符
- Bash shell的算术运算有四种方式
- SHELL从APNIC获取IP地址
- Linux Shell编程入门
- [shell脚本] linux shell简介
- 使用RMAN和控制文件备份删除归档日志的SHELL脚本--RED HAT 5 LINUX 64
- shell函数的调用执行
- shell正则表达式实例解析
- linux shell 条件测试
- Linux shell编程
- shell脚本:一次读取文件的一行,并输出
- 日志分析的shell脚本
- Shell编程基础(转载)
- linux shell编程
- shell date命令使用
- 说说Shell在代码重构中的应用
- ICS lab9 TinyShell 的10条建议
- 交互式提示shell脚本