Unnecessary space in output when using Write-Host

前端 未结 2 659
南笙
南笙 2021-01-19 07:56

When I use Write-Host within a Foreach-Object, I get an unnecessary space in the output.

write-host \"http://contoso.com/personal/\         


        
2条回答
  •  独厮守ぢ
    2021-01-19 08:17

    Just do it without write-host:

    "http://contoso.com/personal/{0}" -f $_.ADUserName
    

提交回复
热议问题