Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-DcnRepairClone doesn't work when run remotely #179

Open
blitzmann opened this issue Mar 17, 2022 · 0 comments
Open

Invoke-DcnRepairClone doesn't work when run remotely #179

blitzmann opened this issue Mar 17, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@blitzmann
Copy link
Contributor

blitzmann commented Mar 17, 2022

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.

@sanderstad sanderstad added the bug Something isn't working label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants