| 用途 | 读取文本/日志文件 |
|---|---|
| 语法 | Get-Content [-Path] <文件> [-TotalCount N] [-Tail N] [-Wait] [-Encoding UTF8] |
| 别名 | cat、type、gc |
常用示例
常用示例
Get-Content D:\Logs\app.log -Tail 50
Get-Content D:\Logs\app.log -Wait -Tail 10
(Get-Content cfg.ini) -match 'port'-Tail 类似 tail -n,-Wait 类似 tail -f;大文件不要整读,先 Tail 或 Select-String。