Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

write-output $var verses just $var

$
0
0

Hello,

is there any difference between this:

Write-Output $var

and just this:

$var

?

and how would those previous examples differ from this:

return $var

?

I know everything that is not directed elsewhere is 'output' in powershell, but I'm wondering about the differences, if any between these variations... I know 'return' will exit the function and return the variable if specified, but I still thought it would be good to include it in this question... I'm mainly concerned about the difference, if any, between the first two examples.. but explaining that, and how they differ from using return, would be a great resource for others to find later as well.

thanks!




Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>