title: Passing a variable from Powershell to DISM
body: <p>I have been trying to run DISM via Powershell but I seem to have a problem passing a variable from Powershell to DISM. I am open to suggestions if there is a better way to pass my drive letter $dl to DISM.</p>
  
  <pre><code>$dl=(Mount-DiskImage -ImagePath "\\domain\shares$\IT\ISO\Desktops\Microsoft\SW_DVD5_WIN_EDU_10_1703_64BIT_English_MLF_X21-36554.ISO" -PassThru | Get-Volume).DriveLetter
  
  RunAs /user:domain\svcaccount (Dism /online /enable-feature /featurename:NetFX3 /All /Source:{$dl}:\sources\sxs /LimitAccess)
  </code></pre>