I am trying to create a script to run an exe
that would be located inside userprofile
folder, but I cant seem to get the command working. Any idea how I can get this working?
I tried:
$env:userprofile\es-cli\es.exe myParameter
I got an error saying:
Unexpected token '\es-cli\es.exe' in expression or statement.
Also tried:
($env:userprofile)\es-cli\es.exe myParameter
got an error unexpected token \es-cli\es.exe
`$($env:userprofile)\es-cli\es.exe myParameter`
got an error the term $ is not recognized as the name of a cmdlet...
$loc = "{0}\es-cli\es.exe" -f $env:userprofile
$loc myParameter # cant do this because $loc is a string