I need to run a command as a variable. I am doing
>$exec = "C:\Windows\system32\notepad.exe"
> $exec "C:\temp\test.txt"
At line:1 char:7
+ $exec "C:\temp\test.txt"
+ ~~~~~~~~~~~~~~~~~~
Unexpected token '"C:\temp\test.txt"' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
What is missing?