【发布时间】:2017-06-23 13:46:39
【问题描述】:
在命令提示符下,您可以通过以下方式创建内联文本文件:
copy con file.txt
Hello World
^Z
或者:
type con > file.txt
Hello World
^Z
Powershell 中是否有等效的命令?我上面列出的两个命令都不起作用。
【问题讨论】:
-
cmd /c copy con file.txt -
@Bill_Stewart - 是的,这行得通,但感觉像是作弊。 :)
-
骗子:
notepad file.txt也很方便,因为它会显示文件编码。 -
我对你不使用 notepad.exe 的理由很感兴趣 :)