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

New-DcnClone: Errors w/ SQL Server's default location when run remotely #164

Closed
4 tasks done
lowlydba opened this issue Jan 28, 2022 · 1 comment
Closed
4 tasks done

Comments

@lowlydba
Copy link
Contributor

Before submitting the bug

  • Ensure you are able to reproduce it on the latest released version (we release often)
  • Verified this bug is not already reported in an issue
  • Verified errors are not related to permissions
  • Can reproduce in a clean PowerShell session (clean = powershell -NoProfile)

Describe the bug
When not supplying -Destination to New-DcnClone and running this command remotely, the path resolution fails since the path is only valid on the remote host.

I think since we're fetching from the instance's default data dir, we can safely just + the values together instead? That has worked for me locally. Happy to make a PR if that works as a solution.

# Check destination
if (-not $Destination) {
$Destination = Join-PSFPath -Path $server.DefaultFile -Child "clone"
}

To Reproduce
Steps to reproduce the behavior:

New-DcnClone -SqlInstance "RemoteSqlIntance" -CloneName $CloneName -Database $Database -LatestImage -Verbose

results in

Join-Path : Cannot find drive. A drive with the name 'X' does not exist.
At C:\Program Files\WindowsPowerShell\Modules\PSFramework\1.6.214\PSFramework.psm1:11474 char:21

Expected behavior
It should be able to handle a default data directory that doesn't exist on the local machine when the destination instance is remote.

@bortolin
Copy link
Contributor

I have make PR about this, recently #166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants