Jim Lahman's Blog

Fortitude|Endurance|Faith|Teamwork

  Home  |   Contact  |   Syndication    |   Login
  30 Posts | 0 Stories | 18 Comments | 0 Trackbacks

News

Archives

Links

Social

Thursday, May 14, 2009 #

I'm beginning to write simple scripts in powershell.  One of the things items that really isn't straight forward is the write-output command.  At first glance, one would think that this would simply output a string.  Well, there is a trick I found.

PS>write-output xxxxxxxx yyyyyyyyy

really outputs

xxxxxxxx
yyyyyyyyy


PS>write-output "xxxxxxxx yyyyyyyyy"

really outputs

xxxxxxxx yyyyyyyyy

PS> $A = 10
PS>$B = 20
PS>write-output "A = $A   B = $B"

really outputs

A = 10  B = 20
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati