I successfully added my mysql path to System Variables in Windows variable Path. If I run cmd and then mysql.exe. It will execute the program without problems.
I want to run mysql.exe from PowerShell
$mysql = "mysql.exe"
$params = "-C","-B","-h$server","-P$port","-u$user","-p$password",$db,"-e$query"
& $mysql @params
I tried ./mysql.exe and mysql.exe but it's not working.
I get the error: The term 'mysql.exe' is not recognized as the name of a cmdlet, function, script file, or operable program.
Thanks in Advance for your Help.
.\commandor./commandis not dot-sourcing. Dot-sourcing is when there is a space after the dot. Runhelp about_Scopesfor more details and read the section titled "Using Dot Source Notation with Scopes."