PowerShell中的Get-Content cmdlet对于检索文件或函数的内容很有用。此cmdlet在PowerShell 3.0中引入。当此cmdlet读取文件时,它一次读取一行,最后将整个内容作为对象的集合返回。
Get-Content [-ReadCount <Int64>] [-TotalCount <Int64>] [-Tail <Int32>] [-Path] <String[]> [-LiteralPath] <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force] [-Credential <PSCredential>] [-Delimiter <String>] [-Wait] [-Raw] [-Encoding <Encoding>] [-AsByteStream] [-Stream <String>] [<CommonParameters>]