This seems like something that should be painfully obvious, but for whatever reason I can't figure it out. From within powershell, I'd like to be able to print the contents of a text file to the host window (or pipe it into another command). I'm looking for so开发者_运维问答mething like this:
PS C:\> {some command} README.TXT
These are the contents of the Readme.txt file!
You are looking for:
get-content README.TXT
In short:
gc README.TXT
If you are used to cat
, you can use that too, it is just an alias for the above in Powershell.
It exists also :
${full path file}
Ex :
${c:\silogix\t.txt}
try it:
get-content .\README.TXT
精彩评论