I need copy pdf files between Source and Destination server, but pdf files are stored on Source server only as shortcuts to web address (FileName.pdf.url files).
Network source/destination shares mapped as disk D: and E:
Copy-Item -Path D:\FileName.pdf.url -Destination E:\FileName.pdf
copy only .url shortcut, I need copy pdf file.
When I open properties of file by Windows explorer in 'Web Content' tab visible is URL address. For example https://ServerName.int:11443/AFUWeb/RetrieveDocument.do?r=ieXZcv-OHZHB465.pdf.
powershell 5.1 w2k12
How received URL info from powershell level.
Get-ChildItem, Get-ItemProperty doesn't received this information for .url files
I found out how download pdf file from remote server, but need pdf web address to provide URL address as variable for 'DownloadFile' as below
$NewFile = New-Object System.Net.WebClient
$NewFile.DownloadFile("**https://ServerName.int:11443/AFUWeb/RetrieveDocument.do?r=ieXZcv-OHZHB465.pdf**","C:\Temp\test.pdf")
$NewFile = New-Object System.Net.WebClient
$NewFile.DownloadFile("**$URLVariable**","C:\Temp\FileName.pdf")