You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running from source using the debug script found here: #138 (comment)
I am attempting to run Dcn-NewClone from my local machine, to create a clone on a remote sql host. The SQL host has dbaclone installed already and we utilize it, but we have to remote in to issue the commands directly.
When running the following command locally, I get a bunch of errors: new-dcnclone -database keylime -latestimage -clonename keylime_new -sqlinstance whsqldev01 -destination z:\sql_clones
Join-Path : Cannot find drive. A drive with the name 'z' does not exist.
At C:\Program Files\WindowsPowerShell\Modules\PSFramework\1.6.205\PSFramework.psm1:11474 char:21
+ ... $resultingPath = Join-Path -Path $resultingPath -ChildPath $childItem
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (z:String) [Join-Path], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand
Cannot bind argument to parameter 'Path' because it is an empty string.
+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand
+ PSComputerName : WHSQLDEV01
Cannot bind argument to parameter 'Path' because it is an empty string.
+ CategoryInfo : InvalidData: (:) [New-Item], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.NewItemCommand
+ PSComputerName : WHSQLDEV01
Join-Path : Cannot find drive. A drive with the name 'z' does not exist.
At C:\Program Files\WindowsPowerShell\Modules\PSFramework\1.6.205\PSFramework.psm1:11474 char:21
+ ... $resultingPath = Join-Path -Path $resultingPath -ChildPath $childItem
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (z:String) [Join-Path], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand
Cannot bind argument to parameter 'Path' because it is an empty string.
+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand
+ PSComputerName : WHSQLDEV01
The term 'New-VHD' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
+ CategoryInfo : ObjectNotFound: (New-VHD:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : WHSQLDEV01
z:\sql_clones exists on the SQL host, and the same command works when issued on that host.
I've tracked it down to the following line in Dcn-NewClone:
Join-PSFPath does not seem to work correctly when running in admin (which the script forces you to do). It seems to check to make sure that the drive exists on the local machine instead of just... well, doing it's job and concatenating into a path.
I know Join-PSFPath isn't part of this project, but I'm wondering if there's an alternative that should be used for instances like this.
A workaround (untested, will check soon) may be to symlink z drive onto a drive that is shared by both local machine and host (ofc, this would be c drive), but this is ofc hacky.
The text was updated successfully, but these errors were encountered:
Looks like [System.IO.Path]::Combine($Destination,$mountDirectory) would work, I'll make a PR, however I don't know how prevalent it is. I'll keep poking around as I test things
Join-Path had the same issues. Seems ridiculous to me, but it is what it is. This is the reason I use Combine as it doesn't validate the existence of a drive
Current set up:
Running from source using the debug script found here: #138 (comment)
I am attempting to run
Dcn-NewClone
from my local machine, to create a clone on a remote sql host. The SQL host has dbaclone installed already and we utilize it, but we have to remote in to issue the commands directly.When running the following command locally, I get a bunch of errors:
new-dcnclone -database keylime -latestimage -clonename keylime_new -sqlinstance whsqldev01 -destination z:\sql_clones
z:\sql_clones
exists on the SQL host, and the same command works when issued on that host.I've tracked it down to the following line in
Dcn-NewClone
:$accessPath = Join-PSFPath -Path $Destination -Child $mountDirectory
Join-PSFPath
does not seem to work correctly when running in admin (which the script forces you to do). It seems to check to make sure that the drive exists on the local machine instead of just... well, doing it's job and concatenating into a path.I know
Join-PSFPath
isn't part of this project, but I'm wondering if there's an alternative that should be used for instances like this.A workaround (untested, will check soon) may be to symlink z drive onto a drive that is shared by both local machine and host (ofc, this would be c drive), but this is ofc hacky.
The text was updated successfully, but these errors were encountered: