Hello folks , I am stuck
I am running a simple command
Import-Module "VMware.VimAutomation.Core"
Connect-VIServer something.something.vcenter1
$vms = Import-CSV D:\Scripts\~\adhoc.csv
foreach ($vm in $vms){
$vmn = $vm.vmname
Invoke-VMScript -vm $vmn -ScriptText "ping something.something" -GuestUser $GuestCred -GuestPassword $GuestPass -ScriptType Bat
}
I am getting the follow error:
Invoke-VMScript : 3/5/2019 7:45:31 PM Invoke-VMScript Exception has been thrown by the target of an invocation.
At D:\Scripts\~\dr_adhoc.ps1:90 char:9
+ Invoke-VMScript -vm $vmn -ScriptText "ping something.something" -GuestU ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-VMScript], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.InvokeVmScript
If I run the same command on a non windows 2016 it works without any problem I am curios if it is something else