79617461

Date: 2025-05-12 08:30:58
Score: 1.5
Natty:
Report link

I just wanted to take a moment to thank both of you @mklement0 and @Bitcoin Murderous Maniac for your incredible help. After much effort and troubleshooting, I have finally managed to solve the issue with your help 🎉 Here is my solution I'd like to use until further notice:

$InstallerPath = "C:\tmp\PathToExe.exe"
$argList=@('-q','-c','-dir','C:\Installer\target\directory')

$ScriptBlock = {
    param(
        Parameter()][string]$PathToExe,
        Parameter()][System.Object[]]$ArgumentList
    )
        # Just for debugging
        "PathToExe: $PathToExe, args: $ArgumentList"
    
        & $PathToExe $ArgumentList | Write-Output;
        $LASTEXITCODE
    }
                    
Invoke-Command -Session $SessionHost `
    -ScriptBlock $ScriptBlock `
    -ArgumentList $InstallerPath,$argList `
    -AsJob

With this solution, I hope, this is a quite future proof solution and I shouldn't get any troubles for the next installers/EXE files.

Thanks again for your support!

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @and
  • User mentioned (0): @for
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: LukasHT