1 2 Previous Next 16 Replies Latest reply on Aug 14, 2018 6:25 AM by JStars Go to original post
      • 15. Re: vmexe HP files execution with PowerCLI
        Robert ¯\_ツ_/¯ Enthusiast

        Hello!

         

        Can you try this:

         

        Create a cmds.txt with this content (without the "----" of course ):

        -------------------------------------------------

        cd /tmp

        chmod a=rwx CP035395*

        ./CP035395.vmexe -h

        -------------------------------------------------

         

        And then this PS Script:

        -------------------------------------------------

        $esx_admin = "root"

        $esx_pass = "password"

        $esx_host = "ESXi IP/FQDN"

         

        $exe_plink = "plink.exe"

        $cmds_plink = "cmds.txt"

         

        $cmd_arg = "/c echo n | $exe_plink -ssh $esx_host -l $esx_admin -pw $esx_pass -m $cmds_plink"

         

        Start-Process "cmd" -ArgumentList $cmd_arg -Wait -RedirectStandardOutput 1juhu.log -RedirectStandardError 2err.log

        ----------------------------------------------

         

        The last line in the "cmds.txt" only prints the help of the vmexe which you can see in the "1juhu.log" - something like: "OS Version found  [6.5.0]..."

         

        In the 2err.log are all errors. In the case of "-h" there is always this line:

         

        ./hpsetup: [-h] | [-d[<file>]] | | [--source=<dir> | [-s] [-f] [-r] [-e] [-g]

         

        If you like to flash change the last line in the cmds.txt from

         

        ./CP035395.vmexe -h

         

        to

         

        ./CP035395.vmexe -s -r

         

        -s = Silent, no User Interaction

        -r = Reboot

         

        Hope this helps.

         

        Robert

        Drink coffee.. Do stupid things faster with more energy...
        • 16. Re: vmexe HP files execution with PowerCLI
          JStars Enthusiast

          many thanks! I moved to a different department and I can't try it out, however I'll keep the script.. you never know!! Cheers!

          1 2 Previous Next