Sep 17 2020 11:31 AM
Is there a way I can add a variable with inverted commas along with text to a file using powershell?
for example:
$name = Read-host -prompt "Enter your name"
echo {Your name is "$name"} >name.txt
pause
When I run it the variable no longer has its value, is there a solution for this
Sep 17 2020 01:45 PM
Remove the echo
$name = Read-host -prompt "Enter your name"
"Your name is $($name)" >name.txt
Sep 18 2020 11:16 AM
Sep 19 2020 12:10 AM
SolutionSep 19 2020 02:40 AM
Sep 19 2020 12:10 AM
Solution