Hi PS Experts,
I am very new to PS.
I am trying to pass a directory name as parameter to a PS script and use a windows executable under that directory to do something. My power shell script is called like below
./script1.ps1 "C:\app\tin"
Inside the script (script1.ps1) I am calling the executable as below
param(
[string]$DIR
)
$DIR\temp\sc.exe
But when I execute, I am getting an error as below
Unexpected token '\temp\sc.exe' in expression or statement.
Why my PS script is not taking the directory name C:\app\tin? The sc.exe script is saved under C:\app\tin\temp\sc.exe
Thanks,
Sethu
I am very new to PS.
I am trying to pass a directory name as parameter to a PS script and use a windows executable under that directory to do something. My power shell script is called like below
./script1.ps1 "C:\app\tin"
Inside the script (script1.ps1) I am calling the executable as below
param(
[string]$DIR
)
$DIR\temp\sc.exe
But when I execute, I am getting an error as below
Unexpected token '\temp\sc.exe' in expression or statement.
Why my PS script is not taking the directory name C:\app\tin? The sc.exe script is saved under C:\app\tin\temp\sc.exe
Thanks,
Sethu