@@ -2525,11 +2525,24 @@ function Start-YCruncher {
2525
2525
# This doesn't steal the focus
2526
2526
# We need to use conhost, otherwise the output would be inside the current console window
2527
2527
# Caution, calling conhost here will also return the process id of the conhost.exe file, not the one for the Y-Cruncher binary!
2528
- # Triple double quotes?
2529
- $processId = [Microsoft.VisualBasic.Interaction ]::Shell((' conhost """' + $stressTestPrograms [' ycruncher' ][' fullPathToExe' ] + ' """ config """' + $stressTestConfigFilePath + ' """' ), ' MinimizedNoFocus' )
2528
+
2529
+
2530
+ # TODO: There seem to be some problems with starting the process here. Need to investigate
2530
2531
# $processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost "' + $stressTestPrograms['ycruncher']['fullPathToExe'] + '" config \"' + $stressTestConfigFilePath + '\"'), 'MinimizedNoFocus')
2531
2532
# $processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost "' + $stressTestPrograms['ycruncher']['fullPathToExe'] + '" config \"' + $stressTestConfigFilePath + '\"'), 'NormalNoFocus')
2532
2533
# $processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost "' + $stressTestPrograms['ycruncher']['fullPathToExe'] + '" config \"' + $stressTestConfigFilePath + '\"'), 'Hide')
2534
+
2535
+
2536
+ # The escape character in Visual Basic for double quotes seems to be... a double quote!
2537
+ # So a triple double quote is actually interpreted as a single double quote here
2538
+ $processId = [Microsoft.VisualBasic.Interaction ]::Shell((' conhost """' + $stressTestPrograms [' ycruncher' ][' fullPathToExe' ] + ' """ config """' + $stressTestConfigFilePath + ' """' ), ' MinimizedNoFocus' )
2539
+
2540
+
2541
+ # Possible alternative using cmd /K with even more quotes
2542
+ # Note that this will not work with the GetWindows() call to match against "^.*00-x86\.exe$", as the window title doesn't end with .exe, but with
2543
+ # "[...]00-x86.exe" config "[...]\stressTest.cfg"
2544
+ # $processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost.exe cmd /K """"""' + $fullPathToExe + '""" config """' + $stressTestConfigFilePath + '""""""'), 'MinimizedNoFocus')
2545
+
2533
2546
2534
2547
# Cannot use the returned $processId here
2535
2548
# $Script:windowProcess = Get-Process -Id $processId
0 commit comments