Sure, try something like this
$vmName="server01"
$snapName="Master"
$cloneName="cloned-$vmName"
$esxName="MyEsx"
$dsName="datastore1"
$vm=Get-VM-Name$vmName
if($vm.PowerState-eq"PoweredOff"){
Try {
$snap=Get-Snapshot-Name$snapName-VM$vm-ErrorActionStop
}
Catch {
$snap=New-Snapshot-Name$snapName-VM$vm
}
$cloneParams=@{
Name=$cloneName
VM=$vm
ReferenceSnapshot=$snap
LinkedClone=$true
VMHost=$esxName
Datastore=$dsName
}
New-VM@cloneParams
}