5 May, 2015
0 Comments
1 category
If you want to format a string when echoing to the screen, use parentheses.
Echo("This is {0} " -f "a test.")
Will output:
This is a test.
Note
echo
is an alias for Write-Output
, which writes to the Success output stream. This allows output to be processed through pipelines or redirected into files. Write-Host
writes directly to the console, so the output can’t be redirected/processed any further.
Tags: PowerShell
Category: Uncategorized