Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

issue with Invoke-VMScriptPlus v3

$
0
0

Hi,

 

I am getting the below error when used the Invoke-VMScriptPlus v3 function

 

$vmName = 'mypup1.abc.loc'

$credVM = Get-VICredentialStoreItem -Host $vmName

$cred = New-Object System.Management.Automation.PSCredential ($credVM.User, (ConvertTo-SecureString $credVM.Password -AsPlainText -Force))

 

$sInvoke = @{

    VM = $vmName

    GuestCredential = $cred

    ScriptText = 'sudo ls -l /opt'

    ScriptType = 'bash'

    Sudo = $true

}

Invoke-VMScriptPlus @sInvoke

 

error :

Invoke-VMScriptPlus : Cannot process argument transformation on parameter 'VM'. Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

At D:\Downloads\Invoke-VMScriptPlus.ps1:621 char:21

+ Invoke-VMScriptPlus @sInvoke

+                     ~~~~~~~~

    + CategoryInfo          : InvalidData: (:) [Invoke-VMScriptPlus], ParameterBindingArgumentTransformationException

    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Invoke-VMScriptPlus


Viewing all articles
Browse latest Browse all 175326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>