Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Checking the creation date and time of a file located at a URL

$
0
0

Hello

Can someone please help with the following question.

I have a file located at a URL lets call it http://Web01/folder/file.txt

I want to check the date and time the file was created.

if I do 

(New-Object System.Net.WebClient).DownloadFile("http://Web01/folder/file.txt", "C:\temp\file.txt")

The file is downloaded and now I have a copy of the file at C:\temp\file.txt

The problem is the creation datetime of  C:\temp\file.txt  is now e.g. the date and time I downloaded the file.

What I need to achieve is, I need to know the date and time of the file http://Web01/folder/file.txt  

Therefore I need to inspect the file 'in situ' and retrieve creation datetime

Is there another method on the System.Net.WebClient class that will give me this information or do I have to use invoke-webrequest or some other method?

Thanks All

AAnotherUser__


Viewing all articles
Browse latest Browse all 6937

Trending Articles