Menu

#472 Unable to run command line PS script in 1.6.14+

1.6.17
Invalid
nobody
None
High
Task
2017-04-08
2016-12-21
Swin
No

Hi,

I had a crash previously that I could not replicate, however, the PS command that worked in 1.6.13 does not work in 1.6.16

Test folder structure

C:\Log\Parsed

Test file contents: C:\Log\Parsed\mylog.log

2016-12-20T15:30:02.165+00:00 node 2016-12-20 15:30:02,165 Level="INFO" Name="support.h323.h245" Message="Received H.245 message" Src-address="10.0.0.1" Src-port="5556" Dst-address="10.1.0.1" Dst-port="33300" Uuid="371c5ac5-fcbb-4e76-aab7-8983132e9008" Detail="command:^M  miscellaneousCommand:^M    logicalChannelNumber: 2^M    type: videoFastUpdatePicture:^M      Null"

PS Commands: Run from C:\Log\

$PathToGrepWin = "C:\Program Files\grepWin\grepWin.exe"
$ParsedLogDir ="\parsed\"
$GepWinArgumentList = """/searchpath:"".$ParsedLogDir"" /k:yes /size:-1 /searchfor:""\^M"" /regex:yes /replacewith:""\r\n"" /filemaskregex:"".*support.*"" /executeReplace /closedialog"

Start-Process $PathToGrepWin -ArgumentList "$GepWinArgumentList" -PassThru

grepWin starts, but immedaitely diaspears.

In 1.6.13, this works.I think this is simply gett the quote in the right place.

Discussion

  • Swin

    Swin - 2016-12-21

    Would you believe it, it was simply a matter of adding a space afer the $ParsedLogDir and before the double quote in the Argument list, such as:

    $GepWinArgumentList = """/searchpath:"".$ParsedLogDir "" /k:yes /size:-1 /searchfor:""\^M"" /regex:yes /replacewith:""\r\n"" /filemaskregex:"".*support.*"" /executeReplace /closedialog"
    

    Slightly anoying for upgrading scripts. Not sure what changed here.

     

    Last edit: Swin 2016-12-21
  • Stefan Kueng

    Stefan Kueng - 2017-04-08
    • status: New --> Invalid