diff --git a/functions/clone/Invoke-DcnRepairClone.ps1 b/functions/clone/Invoke-DcnRepairClone.ps1 index 19dbee7..c6f5123 100644 --- a/functions/clone/Invoke-DcnRepairClone.ps1 +++ b/functions/clone/Invoke-DcnRepairClone.ps1 @@ -133,7 +133,10 @@ # Check if the parent of the clone can be reached try { - $null = New-PSDrive -Name ImagePath -Root (Split-Path $image.ImageLocation) -Credential $Credential -PSProvider FileSystem + $drive = Get-PSDrive -Name ImagePath -ErrorAction SilentlyContinue + if (-not $drive) { + $null = New-PSDrive -Name ImagePath -Root (Split-Path $image.ImageLocation) -Credential $Credential -PSProvider FileSystem + } } catch { Stop-PSFFunction -Message "Could not create drive for image path '$($image.ImageLocation)'" -ErrorRecord $_ -Continue