I am trying to run cmd command using Powershell.
CMD
cd C:\apache-jmeter-5.2.1\bin
jmeter -n -t C:\User-search.jmx -l C:\Result.jtl
Powershell
$command = @'
cmd.exe /C C:\apache-jmeter-5.2.1\bin\jmeter -n -t C:\User-search.jmx -l C:\Result.jtl
'@
Invoke-Expression -Command:$command
Error
cmd.exe : The term 'cmd.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.