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
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
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Without showing us how you call Invoke-VMScript and showing what value you pass on the ScriptText parameter that will be difficult.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
$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
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
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
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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