title: How to pass powershell variable value to cmd.exe?
body: <p>I am trying to install a service 'ServiceName' from the command prompt, with parameter values which I am taking as user input forms through powershell.</p>
  
  <pre><code>$server = $return[0]
  
  Invoke-Expression -Command "cmd.exe /c ServiceName --install --server=$server"
  </code></pre>
  
  <p>Basically the ServiceName service takes parameter values from server variable while installing. I am not exactly sure if this is the correct way of using powershell variable values in cmd.exe. Can the cmd.exe take in the server variable value in the manner shown above? </p>