[英]out put to a file all on one line powershell
代碼-
Write-Output "No. Excluded files:" $Global:exclusioncount | Out-File DryRun.txt -append
但是,變量在另一行上輸出。 無論如何,要使其在同一行上輸出?
您可以通過以下三種方法解決此問題:
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.