hi all,<\/p>\n
so stuck on this and trying to figure out why<\/p>\n
echo $fn\" \"$ln\nrobert wild\nPS C:\\Users\\robert.wild.admin.PROD> $mailfl = $fn\" \"$ln\nParserError:\nLine |\n 1 | $mailfl = $fn\" \"$ln\n | ~~~\n | Unexpected token '\" \"' in expression or statement.\n<\/code><\/pre>\n
Advertisement
so doing a echo works but when i try to make it a variable it says bad token<\/p>\n
thanks,
\nrob<\/p>","upvoteCount":5,"answerCount":6,"datePublished":"2025-05-07T17:40:00.620Z","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"},"acceptedAnswer":{"@type":"Answer","text":"
$mailfl = $fn + \" \" + $ln<\/code>
\nor
\n$mailfl = \"$fn $ln\"<\/code> (this is close to yours but you have quotes in the wrong place)<\/p>","upvoteCount":4,"datePublished":"2025-05-07T18:03:52.225Z","url":"https://community.spiceworks.com/t/making-a-variable-from-variable/1203522/3","author":{"@type":"Person","name":"Rod-IT","url":"https://community.spiceworks.com/u/Rod-IT"}},"suggestedAnswer":[{"@type":"Answer","text":"hi all,<\/p>\n
so stuck on this and trying to figure out why<\/p>\n
echo $fn\" \"$ln\nrobert wild\nPS C:\\Users\\robert.wild.admin.PROD> $mailfl = $fn\" \"$ln\nParserError:\nLine |\n 1 | $mailfl = $fn\" \"$ln\n | ~~~\n | Unexpected token '\" \"' in expression or statement.\n<\/code><\/pre>\nso doing a echo works but when i try to make it a variable it says bad token<\/p>\n
thanks,
\nrob<\/p>","upvoteCount":5,"datePublished":"2025-05-07T17:40:00.701Z","url":"https://community.spiceworks.com/t/making-a-variable-from-variable/1203522/1","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"
[quote=“robert k wild, post:1, topic:1203522, username:robertkwild”]
\n$mailfl = $fn\" \"$ln<\/code>
\n[/
\nif that is powershell it should be
\n$mailfl = $fn + \" \" + $ln<\/code>
\nIt looks like powershell except for the echo statements.<\/p>","upvoteCount":4,"datePublished":"2025-05-07T18:01:54.634Z","url":"https://community.spiceworks.com/t/making-a-variable-from-variable/1203522/2","author":{"@type":"Person","name":"molan","url":"https://community.spiceworks.com/u/molan"}},{"@type":"Answer","text":"echo is an alias for Write-Output. There’s a lot of “DOS” aliases in PowerShell (which is super handy for old farts like me).
\nGet-Alias (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn<\/a><\/p>","upvoteCount":1,"datePublished":"2025-05-07T18:59:52.821Z","url":"https://community.spiceworks.com/t/making-a-variable-from-variable/1203522/4","author":{"@type":"Person","name":"tim-smith","url":"https://community.spiceworks.com/u/tim-smith"}},{"@type":"Answer","text":"