PSAPPDep with DISM

Hi there,
i would like use following line into PSAPPDEP but my syntax is wrong and i don´t know what the right one is.

Execute-Process -Path '$envWinDir\System32\DISM.exe' -Parameters "/Online /Add-ProvisionedAppxPackage /PackagePath:"$dirFiles\Microsoft.SurfaceHub_2015.206.1.3943_neutral_~_8wekyb3d8bbwe.appxbundle" /LicensePath:"$dirFiles\Microsoft.SurfaceHub_8wekyb3d8bbwe.xml" -PassThru

thanks a lot.
andré

Use double quotes instead of single quotes around variable names. Single quote means that the text should be treated as a text literal. Double quotes tells the PowerShell interpreter to expand variables.

I use the backtick ` escape character when I need to use quotes.

Execute-Process -Path '$envWinDir\System32\DISM.exe' -Parameters "/Online /Add-ProvisionedAppxPackage /PackagePath:`"$dirFiles\Microsoft.SurfaceHub_2015.206.1.3943_neutral_~_8wekyb3d8bbwe.appxbundle`" /LicensePath:`"$dirFiles\Microsoft.SurfaceHub_8wekyb3d8bbwe.xml`" -PassThru

Ahh, thank you very well.
this was the hint i´m looking for. :wink:

i solved this so but your way is shorter. :slight_smile:

$DISM = $env:WinDir + ‘\System32\DISM.exe’
$POWERSHELL = $env:WinDir + ‘\System32\WindowsPowershell\v1.0\powershell.exe’
$PACKAGE = $dirfiles + ‘\Microsoft.SurfaceHub_2015.516.56.635_neutral_~_8wekyb3d8bbwe.appxbundle’
$LICENSE = $dirFiles + ‘\Microsoft.SurfaceHub_8wekyb3d8bbwe.xml’
Execute-Process -Path $DISM -Parameters “/Online /AddProvisionedAppxPackage /PackagePath:$PACKAGE /LicensePath:$LICENSE”