Issue
this is my current situation. Im trying to hold it short, so please dont ask why i made some things like this:
Im in this path already in: C:\cURL
This works fine: PS C:\cURL> & '.\Extern$\Curl\bin\curl.exe'
-> Like this Im in the curl.exe and i can use it.
But because of some reasons I need to put " .\Extern$ " into a variable, e.g. $Extern Means:
PS C:\cURL>$Extern = ".\Extern$"
So normally this should also work right?
PS C:\cURL> & '$Extern\Curl\bin\curl.exe'
Sadly it doesnt.
To sum up: My aim is to replace this path part .\Extern$
with a variable like $Extern or $path
Thanks for helping!
Solution
Your issue is single quotes '
. They are literal.
$Name = "TestName"
'$Name'
Will return
$Name
While double quotes "
will allow you to display the variable.
$Name = "TestName"
"$Name"
Will return
TestName
For your example
$Extern = ".\Extern$"
& "$Extern\Curl\bin\curl.exe"
Should run .\Extern$\Curl\bin\curl.exe
Answered By - ArcSet Answer Checked By - Marie Seifert (WPSolving Admin)