Closed belotn closed 2 years ago
Hello,
i have host with only powershell 5 and some host with powershell 7 outside of defaut path, in this case, Preview failed with "pwsh not found".
one way to correct it is to check if pwsh is in path and use the avaiable powershell executable in Path.
if(Get-Command pswh -ErrorAction SilentlyContinue){ $PowerShellCMD='pwsh' }elseif( Get-Command powershell -ErrorAction SilentlyContinue){ $PowerShellCMD='powershell' } #(...) $additionalCmd = @{ Preview=$("$PowerShellCMD -NoProfile -NonInteractive -File \""$previewScript\"" \""" + $path + "\"" {}") }
Hello,
i have host with only powershell 5 and some host with powershell 7 outside of defaut path, in this case, Preview failed with "pwsh not found".
one way to correct it is to check if pwsh is in path and use the avaiable powershell executable in Path.