Wednesday, 15 February 2012

How do I create a new txt file in powershell -



How do I create a new txt file in powershell -

i trying create new txt file in powershell , write text it. output palced? im using ise test , isnt outputing file in same place script located. there isnt much code included below.

$text = "<html><header></header><body>hello world!</body></html>" $text|set-content 'file.txt'

if want output file same directory script located utilize $psscriptroot variable e.g:

$text | set-content $psscriptroot\file.txt

powershell

No comments:

Post a Comment