- This topic has 2 replies, 2 voices, and was last updated 2 months, 2 weeks ago by
March 10, 2020 at 8:34 am #209403ParticipantTopics: 4Replies: 8Points: 59Rank: Member
I can’t figure it out. i have this code:
$Uname = $env:UserName $Source = "\\172.30.168.250\Sources\SAPUILandscape.xml" $Destination = "C:\Users\$Uname\AppData\Roaming\sap\common\" Copy-Item –Path $Source –Destination $Destination
I’m getting this error:
Copy-Item : Cannot find path ‘C:\Users\dady\ג€Path \172.30.168.250\Sources\SAPUILandscape.xml ג€Destination’ because it does not exist.
At C:\Users\dady\Desktop\SapGui.ps1:17 char:1
+ Copy-Item ג€“Path $Source ג€“Destination $Destination
+ CategoryInfo : ObjectNotFound: (C:\Users\dady\ג…l ג€Destination:String) [Copy-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
What i’m not doing right?
Thanks in advance
March 10, 2020 at 7:25 pm #209532ParticipantTopics: 4Replies: 82Points: 250Rank: Participant
There are some weird characters in your error message. My guess is that is an environment difference (language). At any rate, the error message is simply saying the destination path doesn’t exist so this is not an issue with your code necessarily, but the path simply doesn’t exist. If you need to create the path, you can do that with New-Item. https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/New-Item?view=powershell-5.1
March 11, 2020 at 5:58 am #209586ParticipantTopics: 4Replies: 8Points: 59Rank: Member
Thanks Mike for your reply. I also saw this weird characters and i have no clue where they are coming from.
I manged solving my issue with this code:
$Uname = $env:UserName
Copy-Item -Path "Microsoft.PowerShell.Core\FileSystem::\\172.30.168.250\Sources\SAPUILandscape.xml" -Destination "Microsoft.PowerShell.Core\FileSystem::C:\Users\$Uname\AppData\Roaming\sap\common\"
- This reply was modified 2 months, 2 weeks ago by dady48.
- You must be logged in to reply to this topic.