Automation

 View Only
Expand all | Collapse all

Invoke-VMScript returning an error I dont understand

  • 1.  Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 04:44 AM

    Hi All,

    I am trying to run a script against my vSphere guest machines. I am getting the following error on Windows 10 machines. It works against most of the windows 8 machines.

    The 'propSet' paramter should not be null. Here is thefullerror message

    Invoke-VMScript : 11/23/2021 8:34:42 PM Invoke-VMScript The 'propSet' paramter should not be null. At line:1 char:1 + Invoke-VMScript -vm 00005_Windows_10 -ScriptText {systeminfo.exe | Se ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Invoke-VMScript], ViError + FullyQualifiedErrorId : Client20_VmGuestServiceImpl_DownloadFileFromGuest_DownloadError,VMware.VimAutomation.ViCore.Cmdlets.Commands.InvokeVmScript



  • 2.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 08:10 AM

    CIao 

    can you post the entire invoke-vmscript command that you run?



  • 3.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 04:13 PM

    Thank you for responding. Here is the full script.



  • 4.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 04:07 PM

    We saw this issue before, most of the time it indicates a mixed up installation of PowerCLI.
    See for example PowerCLI Guest OS Cmdlets Error - The 'propSet' pa... - VMware Technology Network VMTN

    Start by doing 



  • 5.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 04:24 PM
      |   view attached

    Thank you for responding. I attached the results of the command. I also uninstalled PowerCLI and then reinstalled. I originally installed following the direction here: https://developer.vmware.com/powercli/installation-guide

    Attachment(s)

    txt
    lucd.txt   25 KB 1 version


  • 6.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 04:47 PM

    I also ran your Test-InvokeVMScript script and here are the results from a box that my script ran successfully on.

     

     



  • 7.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 06:10 PM

    The versions of the PowerCLI modules seem to be ok, so no issue there.

    In the error message you got on Test-InvokeVMScript the text 

    “SilentlyContinue”

    seems to indicate something went wrong while copying the snippet.

    Also, in your script the line 

    Out-File -Append $box

    seems strange, since you are using that variable $box for the name of the VM as well.



  • 8.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 06:19 PM

    Thank you. What is a 'propset' parameter?
    In addition, I purchased your book "VMware vSphere PowerCLI Reference" hoping it would answer this question. It is a grat resource; however, I did  not find a reference to 'propset'

    I removed the weird characters from the Test-InvokeVM script.



  • 9.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 06:27 PM

    I suspect that this 'propSet' name is an internal name used in the code of some PowerCLI cmdlets.
    Normally you shouldn't see that name appear in an error message.

    And yes, the PowerCLI Reference does not handle that specific error.
    The book would be at least twice as thick if had to mention all possible errors (if we even could do that).

    A suggestion, to eliminate any issues on the station where you are encountering this error, does this code produce the same error on another station?
    And do you get the same error with PowerShell v5.1 and PowerShell v7?
    You can install PSv7 side-by-side on a Windows box.



  • 10.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 10:33 PM
      |   view attached

    I installed  Powershell 7 and I am getting much better results. I am getting blank ScriptOut from windows 7, XP, and Some of my Windows 8.



  • 11.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 10:41 PM

    Did you fix that Out-File $box ?
    That is definitely an error in your code.



  • 12.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 10:49 PM

    Out-File $box writes the results to a file and that works as it is.



  • 13.  RE: Invoke-VMScript returning an error I dont understand

    Posted Nov 24, 2021 10:55 PM

    No, it doesn't.
    You're using that same variable with Get-VM

    Or it is a VM name or it is a file, but not both