Description
PS C:\WINDOWS\system32> Invoke-DcnRepairClone
cmdlet Invoke-DcnRepairClone at command pipeline position 1
Supply values for the following parameters:
HostName[0]: whsqldev01
HostName[1]:
Exception calling "InvokeScript" with "4" argument(s): "PowerShell Gallery is currently unavailable. Please try again
later."
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : CmdletInvocationException
+ PSComputerName : whsqldev01
WARNING: [11:07:28][Invoke-DcnRepairClone] Couldn't find clone file 'z:\sql_clones\KeyLime_SC8394.vhdx'
PS C:\WINDOWS\system32>
It seems like it's using Test-Path for the clone location. The clone was created using -Destination z:\sql_clones\
, but when running Invoke-DcnRepairClone
it checks it against my local filesystem, and not the host. It would probably work using a network path -Destination \\whsqldev01\z$\sql_clones\
but this gets funky (needs to have admin access on host to go to drive$ paths) as well as the fact that if you don't specify a Destination it defaults to the Hosts default data directories, which are usually local drives (so it would be saved as C:\Program File\SqlServer\Data` or whatever the host has set).
The test path command should be run on the host, or maybe even better yet, if we detect we're trying to run Invoke-DcnRepairClone
on a remote host, just run the same command on that host instead and return locally. I'll be looking into this option as a potential fix.