Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Passing parameters to Kitchen.bat

  1. #1
    Join Date
    Aug 2009
    Posts
    13

    Default Passing parameters to Kitchen.bat

    Hi,

    I want to run a job using Kitchen.bat and pass a parameter called which has been defined in the settings of the Job, with the parameter being called foo.

    the job is run on the Windows PowerShell like:

    ./Kitchen.bat /rep:PentahoRepo /dir:world /job:mainjob /param:foo=testfilename

    The jobs runs well, but the default value is used, instead of the value that is passed on the command line.

    Looking at the execution result in the Windows shell, /param:foo testfilename seems to be executed instead of /param:foo=testfilename.

    Is this some weird interaction between Windows and Java, not accepting the = sign ?

    I am using PDI 5.3.0

  2. #2
    Join Date
    Aug 2009
    Posts
    13

    Default

    Okay, I solved it myself.

    ./Kitchen.bat /rep:PentahoRepo /dir:world /job:mainjob '/param:"foo=testfilename"'

    did seem to do the trick.

  3. #3
    Join Date
    Apr 2008
    Posts
    4,690

    Default

    The documentation says the same...

    You can also define parameters during execution like this:

    user@host:$ sh pan.sh -file:/tmp/foo.ktr -param:MASTER_HOST=192.168.1.3 -param:MASTER_PORT=8181

    Windows requires you to use quotes around the parameter otherwise the equals sign is treated as a space by the command interpreter:
    c:\> pan.sh -file:/tmp/foo.ktr "-param:MASTER_HOST=192.168.1.3" "-param:MASTER_PORT=8181"

  4. #4
    Join Date
    Aug 2009
    Posts
    13

    Default

    No, I have tried the "/param:foo=mytestfilename" before and it doesn't work. '/param:"foo=testfilename"' does work in the Windows command line (PowerShell). So, I guess that the documentation will have to be updated in order to solve this issue in a Windows environment.

  5. #5
    Join Date
    Apr 2008
    Posts
    4,690

    Default

    Powershell and Windows Command Line are not the same thing.

    If you write a bat file to execute your transformations, you can do the "/param:foo=testfilename" method.

    Do you have a clearer example of running them in a powershell file? The documentation I linked to is a Wiki, so you can create an account and update it to be more accurate.

  6. #6
    Join Date
    Aug 2009
    Posts
    13

    Default

    Okay, I tested this as well and it is true that the Windows Command Line and the PowerShell are different in this respect. The "/param:foo=testfilename" does work in a regular bat file. Nevertheless, this can be useful information for people who use the Windows PowerShell and PowerShell scripts. I will look into updating this information in the wiki.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.