Automation

 View Only
  • 1.  invoke-VMscript error install exe

    Posted Oct 05, 2022 04:29 PM

    Hi gurus

    I did try this with  invoke-vmscript and I am getting this error

    "c:\App.exe : The term 'c:\app.exe' is not recognized
    as
    | the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
    | included, verify that the path is correct and try again."

    My fullpath is :c:\app.exe /quiet /norestart

    what am I doing wrong

     

    Thanks for any help

     



  • 2.  RE: invoke-VMscript error install exe

    Posted Oct 05, 2022 05:19 PM

    Without showing us how you call Invoke-VMScript and showing what value you pass on the ScriptText parameter that will be difficult.



  • 3.  RE: invoke-VMscript error install exe

    Posted Oct 05, 2022 05:24 PM

    $File = "APP.exe"
    $Param = " /quiet /norestart"
    $SrcPath = "C:"
    $Fullpath = $SrcPath + $File
    $cred=Get-credential
    $VM='VDI'


    $Command = $fullpath + $Param

     Invoke-VMScript -VM $VM -ScriptText $Command -GuestCredential $Cred



  • 4.  RE: invoke-VMscript error install exe

    Posted Oct 05, 2022 05:44 PM

    L.

    I think I know what is going on, I was trying to push this install onto all the VDI , but I think that for this to work the app has to be on that location, C:\ on the remote computer, is this correct? and if it is, can Invoke-VMscript run a local installer/exe on the remote computer? or do I have to copy this installer on all VDI/vm and run this script?

     

    Thanks a bunch as always

     



  • 5.  RE: invoke-VMscript error install exe
    Best Answer

    Posted Oct 05, 2022 05:55 PM

    Yes, that is correct.
    That is the "or operable program" part of that error, no EXE found.

    No, Invoke-VMScript can only run something locally in the Guest OS.
    Unless you set up a Remote Session from inside the Guest OS, but then you might hit the double hop issue.

    Best option is to copy the EXE to the Guest OS, you can use Copy-VMGuestFile for that copy



  • 6.  RE: invoke-VMscript error install exe

    Posted Oct 05, 2022 06:44 PM

    L.

     

    thanks a bunch as always, I could not find a remove/delete-vmguestfile , so I guess deleting the same file with the same steps is out of the question.

     

    Thanks a bunch as always L