首页 > 代码库 > 系统学下POWERSHELL吧,工作当中可能用得到呢。不能像以前那样修修改改了。

系统学下POWERSHELL吧,工作当中可能用得到呢。不能像以前那样修修改改了。

把环境,编辑器,版本这些都弄清楚,说不好还能把FCL类库弄懂个大概???:)

 

[DateTime]::IsLeapYear(2008)
$result = [DateTime]"06/21/2008" - [DateTime]::Now
$result.TotalDays
dir
cd c:
pwd
cd cd qiyi
pwd
Get-Item Cache\* | Move-Item -Destination offline
Get-Item offline\* | Copy-Item -Destination Cache
Get-Process
Get-Process|Where-Object { $_.Handles -ge 500 }
Get-Process|Where-Object { $_.Handles -ge 500 }|Sort-Object Handles
Get-Process|Where-Object { $_.Handles -ge 500 }|Sort-Object Handles|Format-Table Handles,Name,Description -Auto
gps [b-t]*[c-r] | Stop-Process | Whatif
gps [b-t]*[c-r] | Stop-Process -WhatIf
Get-Command *process*
"Hello World" | Get-Member
"Hello World".ToUpper
"Hello World" | ToUpper
"Hello World".ToUpper()
$handleCount = 0
foreach($process in Get-Process) { $handleCount += $process.Handles }
$handleCount
$count = 0
foreach($process in Get-Process) { $count += 1 }
$count
$webClient = New-Object System.Net.WebClient
$content = $webClient.DownloadString("http://www.baidu.com")
$content.Substring(0,1000)
Get-History