title: Concatenate strings and expression results in PowerShell
body: <p>I want to write out the current process ID in PowerShell. This works:</p>
  
  <pre><code>$processId = $([System.Diagnostics.Process]::GetCurrentProcess()).Id
  Write-Output "My process ID is $processId"
  </code></pre>
  
  <p>However, I want to do it in one line, if possible. Substituting the <code>$([System.Diagnostics.Process]::GetCurrentProcess()).Id</code> for the variable doesn't seem to evaluate the expression.</p>