简体   繁体   English

全部放到一个文件中

[英]out put to a file all on one line powershell

Code - 代码-

Write-Output "No. Excluded files:" $Global:exclusioncount | Out-File DryRun.txt -append

However the variable gets outputted on a different line. 但是,变量在另一行上输出。 Is there anyway to make it output on the same line? 无论如何,要使其在同一行上输出?

Here are three ways you could solve this: 您可以通过以下三种方法解决此问题:

Write-Output ("No. Excluded files:{0}" -f $Global:exclusioncount) | Out-File DryRun.txt -append

Write-Output "No. Excluded files:$($Global:exclusioncount)" | Out-File DryRun.txt -append

Write-Output ("No. Excluded files:" + $Global:exclusioncount) | Out-File DryRun.txt -append

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM