I think the main advantage really comes down to readability of your code, as it becomes easy at a glance to see that you're sending something to the output.
For instance, even with something as simple as
$foo = "Current date is $(get-date)"
I would argue that scanning through lines of code it's far easier to instantly understand what's happening when you see
Write-Output $foo
than if you just see
$foo
on a line of its own.
It's perhaps worth noting that shortened forms appear to be going out of popularity, or no longer being recommended in the same way. For instance if you edit Powershell code with VS Code you'll perhaps notice it showing warnings for the use of aliases, for instance ft
aliasing Format-Table
, select
aliasing Select-Object
etc, with the same listed reasoning that it makes it harder to maintain the code.
echo
is an alias forWrite-Output
). – Wilcox