Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Re: Trouble passing a function to be executed with Invoke-VMScript

$
0
0

Hi All,

 

I know this is an old thread - but I too was having this exact same problem - and have solved it (Huzzah!)

 

There appears to be an undocumented Character limit for the -scripttext field - it's somewhere around the 2,000 - 3,000 character mark (I didn't have time to endlessly test it to find it) - so passing a simple function (with only a few lines of code) works without issue, passing a complex function fail.

 

2 Things to add here:

 

1: It would be really nice and save a LOT of headaches if the scripttext limit was documented somewhere

2: The invoke-vmscript function should parse the -scripttext field and if it exceeds the limit, fail with an error message that is helpful "the scripttext field exceeds the character limit of XXXX - you may wish to streamline your script or transfer the content using the copy-vmguestfile function first"

(or something)

 

Thanks.


Viewing all articles
Browse latest Browse all 219257


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