I can't output text with variable in double inverted commas to another file using Powershell. I had done it in batch and it worked but it didn't work with Powershell.
Example:
$name = Read-host -prompt "Enter your name" echo {Your name is "$name"} >name.txt pause When I run the file the variable loses its value.