使用powershell将文本添加到.conf文件

时间:2016-03-07 03:34:41

标签: powershell powershell-v3.0

我尝试使用add-content命令将以下行添加到.conf文件但是没有工作,我认为它不起作用的原因是因为该文件不是.txt文件,它是.conf文件。

[sslConfig]

sslVersions = *,-ssl2,-ssl3

cipherSuite = TLSv1.2:!eNULL:!aNULL

allowSslRenegotiation = false

有没有办法使用powershell在.conf文件的末尾添加额外的行?

1 个答案:

答案 0 :(得分:1)

"new line content" | out-file .\ssl.conf -append -encoding ascii