VMware Cloud Community
maraisc
Contributor
Contributor
Jump to solution

Copy-VMGuestFile - The 'propSet' paramter should not be null. Error

Hi All

I have been struggling to get the Copy-VMGuestFile and Invoke-VMScript commands to work in our environment.

I have tried everything on all the forums and scoured the internet.

Below is a list of things tested:

Test/Checks done
Tried on different VM's with different varying OSes (Win 7, Win 10)
Tried using different version of PowerCLI
Disabled the Certs
Specifying the ESXi IP instead of the hostname
Tested while machines are on the same subnet
Opened ESXi welcome page from both initiating and guest computer in the web browser
Even tried connecting to the same VM from which the PowerCLI was running
Run PowerCLI as x86 variant
Required privlages VirtualMachine.GuestOperation.modify and VirtualMachine.GuestOperation.Execute are correct
VMWare Tool on the guest is fully up to date (Version 10.3.5
Firewall disabled on both Guest and PowerCLI OS.

there is no variation on the error message from the command regardless of what is tried.

The command/operation does occur on the guest OS (file is copied to [not from] or command is run).

There is definatly a coms issue rom the VM's to ESXi but I am stumped as how to further narrow it down.

Error from command

Copy-VMGuestFile -Source "c:\temp\test.txt" -Destination "c:\tmp\" -VM $TargetVM -GuestToLocal -GuestCredential $creds -ToolsWaitSecs 10

Copy-VMGuestFile : 2019/04/05 12:39:58 Copy-VMGuestFile The 'propSet' paramter should not be null.
At line:1 char:1
+ Copy-VMGuestFile -Source "c:\temp\test.txt" -Destination "c:\tmp\" -V ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-VMGuestFile], ViError
    + FullyQualifiedErrorId : Client20_VmGuestServiceImpl_DownloadFileFromGuest_DownloadError,VMware.VimAutomation.ViCore.C
   mdlets.Commands.CopyVMGuestFile

We are using has ESXi 6.0 and vSphere 6.0 in the environment.

Powershell V5.1 and PowerCLI 11.2

0 Kudos
1 Solution

Accepted Solutions
maraisc
Contributor
Contributor
Jump to solution

Hi LucD

Thanks for the suggestion. Port 902 and it is closed on our side but reviewing the documentation it refers to this requirement only being applicable to ESX v5.0 and below and we are running ESX v6.0 in the environment. None the less after days of frustration I eventually installed VMware-PowerCLI-6.5.0-4624819.exe. This works without issues although I needed to copy the modules to my PowerShell directory and for now need to import them before running the script.

It seems that none of the modules from the PowerShell Gallery work in our environment, at least not as far as Invoke-VMScript and Copy-VMGuestFile are concerned.

Hopefully this will help some other poor souls struggling with this.

Thanks again for the feedback and suggestions.

Kind Regards

Charl Marais

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Is port 902 open between the ESXi node that hosts the VM and the VM?

You could test with a ssh over port 902.

Did you check the vmware.log (in the VM's folder) for clues?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
maraisc
Contributor
Contributor
Jump to solution

Hi LucD

Thanks for the suggestion. Port 902 and it is closed on our side but reviewing the documentation it refers to this requirement only being applicable to ESX v5.0 and below and we are running ESX v6.0 in the environment. None the less after days of frustration I eventually installed VMware-PowerCLI-6.5.0-4624819.exe. This works without issues although I needed to copy the modules to my PowerShell directory and for now need to import them before running the script.

It seems that none of the modules from the PowerShell Gallery work in our environment, at least not as far as Invoke-VMScript and Copy-VMGuestFile are concerned.

Hopefully this will help some other poor souls struggling with this.

Thanks again for the feedback and suggestions.

Kind Regards

Charl Marais

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I have seen that propSet error once before, it was caused by a faulty installation.

Did you remove the old, MSI based PowerCLI version completely, before installing one of the Gallery versions?

You need to do the Uninstall from Programs and Features, but also remove any PowerCLI folder remaining under C:\Program Files (x86)\VMware\Infrastructure\.

You can find a more detailed in Welcome PowerCLI to the PowerShell Gallery – Install Process Updates


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
maraisc
Contributor
Contributor
Jump to solution

Hi LucD

Prior to posting to this forum I never had any PowerCLI MSI installed. The testes were all conducted using only the Powershell gallery installations.

After installing the MSI though I did try installing a few version from the gallery again but it failed same as before.

I would prefer to be using the latest version in the Gallery but I am uncertain at this point how to get them working or what the difference between the two are.

It may just be a compatibility with our version of ESX in the environment.

Will have another crack at it using the suggested guide and let you know.

Kind Regards

Charl Marais

0 Kudos