PowerShell: cmdlet
Service:
- get-service
- start-service
start-service -name spooler -v
- stop-service
- restart-service
get-service -name spooler | restart-service
- get-service
- get-service | findstr httpd Case-Sensitive
- 获取停止的服务
get-service | where {$_.status -match 'stopped'}
Process
- ps === get-process
文本处理
- get-content === cat
- select-string String file
Select-String:
Select-String -Path D:/b.log -Pattern '\d{2,}' Get-ChildItem -recurse -filter *.log c:/ | Select-String "\w+" | Copy-Item -Destination C:\temp2
$profile:
"`nnew-alias which get-command" | add-content $profile