More powershell fixes

This commit is contained in:
crschnick 2024-03-13 07:32:08 +00:00
parent 0149137abe
commit 21a47de1fa
2 changed files with 4 additions and 4 deletions

View file

@ -37,11 +37,11 @@ public class ApplicationHelper {
}
public static String createDetachCommand(ShellControl pc, String command) {
if (pc.getShellDialect().equals(ShellDialects.POWERSHELL)) {
if (ShellDialects.isPowershell(pc)) {
var script = ScriptHelper.createExecScript(pc, command);
return String.format(
"Start-Process -FilePath powershell.exe -ArgumentList \"-NoProfile\", \"-File\", %s",
ShellDialects.POWERSHELL.fileArgument(script));
"Start-Process -FilePath %s -ArgumentList \"-NoProfile\", \"-File\", %s",
pc.getShellDialect().getExecutableName(), pc.getShellDialect().fileArgument(script));
}
if (pc.getOsType().equals(OsType.WINDOWS)) {

View file

@ -154,7 +154,7 @@ public class ScriptHelper {
var scriptType = parent.getShellDialect();
// Fix for powershell as there are permission issues when executing a powershell askpass script
if (forceExecutable && parent.getShellDialect().equals(ShellDialects.POWERSHELL)) {
if (forceExecutable && ShellDialects.isPowershell(parent)) {
scriptType = parent.getOsType().equals(OsType.WINDOWS) ? ShellDialects.CMD : ShellDialects.SH;
}