Skip to content

New-DcnImage uses $Credential for testing access, instead of $DestinateionCredential #220

@blitzmann

Description

@blitzmann

if (-not $computer.IsLocalhost) {
# Get the result for the remote test
$resultPSRemote = Test-DcnRemoting -ComputerName $computer -Credential $Credential
# Check the result
if ($resultPSRemote.Result) {
$command = [scriptblock]::Create("Import-Module dbaclone -Force")
try {
Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $Credential
}
catch {
Stop-PSFFunction -Message "Couldn't import module remotely" -Target $command
return
}
}
else {
Stop-PSFFunction -Message "Couldn't connect to host remotely.`nVerify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer" -Target $resultPSRemote -Continue
}
}

These commands use $Credential, however they are never defined., I believe it's supposed to be $DestinationCredential. This is currently preventing us from creating a new image on our build server and passing in admin credentials, because it's not actually using them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions