Ok, getting the items through Outlook... totally doable!
#file path
$filepath = "I:\WriteToHere"
#set outlook to open
$o = New-Object -comobject outlook.application
$n = $o.GetNamespace(“MAPI”)
$SPL = $n.Folders | ? { $_.Name -eq "SharePoint Lists" }
Now here's where it takes a bit of work on your part. You will need to find the folder that you are looking for. Do this:
$SPL.Folders|Select Name
Do you see your folder listed where the file can be found? Is it a nested folder? If it is in something like:
\\SharePoint List\Document Library\Daily Files\Lists\04032014.csv
You will have to drill down to the folder it is in. So, here we go with an example for that:
$DocLib = $SPL.Folders|?{$_.Name -match "Document Library"}
$Dailies = $DocLib.Folders|?{$_.Name -match "Daily Files"}
$Lists = $Dailies.Folders|?{$_.Name -match "Lists"}
$TargetFile = $Lists.Items|?{$_.Subject -match "04032014.csv"}
If($TargetFile.DownloadState -eq 1){$TargetFile.SaveAs("$FilePath\$($TargetFile.Subject)")}
So I got the Document Library object, from that I got the Daily Files object, from that I got the Lists object. That gets us to the right folder at last. Once we have the folder we get the Items from it and on each item we get the Subject property which is where it stores the file name, and we filter that for the desired file. Once we have the Item object I checked to see if it was downloaded from the server yet by checking DownloadState. 0 = not downloaded yet, and 1 = downloaded. I suppose we could do something like:
$TargetFile = $Lists.Items|?{$_.Subject -match "04032014.csv"}
If($TargetFile.DownloadState -eq 0){
do{start-sleep 1}while{$TargetFile.DownloadState -eq 0}
}
$TargetFile.SaveAs("$FilePath\$($TargetFile.Subject)")
That would check and see if it's downloaded, and if not it'll wait until it is downloaded, and then save the file.