Part 1
Is the Get-ChildItem property 'lastwritetime' equivalent to explorer's
'Date Modified'?
Part 2
I am running Windows XP. I back up my files to a flash drive. My
current 'cmd' script blindly erases the files from my flash drive and
then 'copies' my working set from my hard drive to the flash drive.
I am writing a PS script that compares the 'lastwritetime' date
between the two media. Interesting enough I have stumbled upon this;
The lastwritetime as it appears on the flash drive is usually 1 to 2
seconds later than the lastwritetime on the hard drive. As I
understand it, these are not the physical times that the files were
copied, but rather when they were modified. So I am wondering why
this inconsistency occurs?
To accommodate this I do something like;
if ($timediff.totalseconds -le 60)
{write-Host "dont copy file $hdFilePath"
$CurrentFileCount++
}
else {
write-Host "copy required for $hdFilePath"
copy-Item $hdFilePath -destination $fdDir
if ($?) {
write-Host "Copy ok for $hdfilepath to $fdDir"
$UpdateCount++
}else {
read-Host -prompt "FAILURE on Copy of $hdfilepath to
$fdDir"}
}
Part 3
Depending on the current state of chaos, my flash-drive's drive letter
may change. So I try to dope out the drive letter of the flash drive
by doing something like;
get-psdrive | foreach-object {if($_.description -like "lexar")
{$flashdrive= $_.name}}
Are there other alternatives and what property suggests that the flash
drive is 'Removable Storage' as described in 'My Computer?
Thank you,
Fred J.


