'New-VM command fails when trying to clone from another VM

$sourceVM = get-vm -name LinuxBox

$referenceSnapshot = Get-Snapshot -VM "LinuxBox" -Name "snapshot1"

$myDatastore = Get-Datastore -Name datastore1

##$vmhost = Get-VMHost
##-ResourcePool $vmhost 

New-VM -Name LinuxTest -VM $sourceVM -LinkedClone -ReferenceSnapshot $referenceSnapshot -Datastore $myDatastore

Above is the code I am trying to use, below I have the error I am getting. I am connected to the ESX server already and all variables contain values. Any insight would be appreciated. ESXi version 6.0. 12.5.0. VMware.PowerCLI

New-VM : 3/31/2022 9:50:14 AM   New-VM          
At line:1 char:1
+ New-VM -Name LinuxTest -VM $sourceVM -LinkedClone -ReferenceSnapshot  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-VM], InvalidProperty
    + FullyQualifiedErrorId : ViCore_Util10_EncryptionServiceHelper_UpdateViewD 
   ata_ViErrror,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source