I am trying to read-host text with spaces and save it into a variable in powershell.
However when the variable is passed as an argument to another command then it ignore the space.
$Name = read-host “enter text here”
enter text here: hello world
ec2-create-tags %1 -t “Name=%2” -t “Server=%3”
In the above command it puts Name= Hello and Server= World
I would like to store Name= Hello World
I am not sure if there is any formatting error? I tried the backtick " backtick " option but it didn’t work either.
Any help would be appreciated.