filecopy with PSdrive

Hi All,
I’m busy testing if a network drive is correctly mapped
#$destination2 = “\\laptop-backup-01\username$”
if(!(test-path Z:)){
write-host “checking if networkdrive is mapped”
$cred = Import-Clixml -Path “${env:\userprofile}\Paulst.Cred”

New-PSDrive -name Z -root $destination -PSProvider FileSystem -Credential $cred
}Else {
Write-Host “drive is mapped”
When I do use the destination2 location it’s working like a charm
however when I use destination location it will fail even when I have this drive correctly mapped in my windows explorer and can access it.
how can I check where it goes wrong?

thanks Paul


has a \ that should be a .



no it’s suppose to be like this

I adapted the names for not reveling the company name