Insert variables from powershell script into HTML -
i have html code , i'd insert variables powershell script into. when insert html in script script thinks part of script itself. i'm trying create signatures company takes in user name, email, phone, ect , inserts info html. i've got variables set having hard time inserting them html.
it sounds want "here-string" this:
$my_html = @' <html> <head></head> <body> <p>hi, name {0}, can email me @ {1} or call me @ {2}.</p> </body> </html> '@ -f $name, $email_addr, $phone_num $my_html | out-file c:\my_html.html -encoding ascii
this technique combines use of here-strings allow use character including quote characters , string formatting put targets in string replaced arguments giving -f
operator. pipe string file open in browser.
Comments
Post a Comment