Cmdlet

Get-Content cmdlet用于读取文本文件的内容。

在本例中,我们读取test.txt文件

Get-Content D:\temp\test\test.txt

输出

我们可以在PowerShell控制台中看到以下输出。

Welcome to onitroad
Powershell-读取文本文件
日期:2019-08-20 13:51:02 来源:oir作者:oir