Hi,
I've got a system.date file variable that I comes back as an object and I want to match it to a variable in date format that is a string. Is this possible?
Here is my code:
$dtime = [datetime]::parseExact($USDate, "dd/MM/yyyy",$null)
$USDate = $dtime | get-date -format dd/MM/yyyy
If I write-host on $USDate it comes back as follows (as a string)
30/09/2018
The system.date object looks like this and is a true system date:
LastModified: 30/09/2018 02:26:24
When I try and match the 2 it never finds it I've tried -like and -match which technically should work.
Here is my where clause:
$count = get-s3object -bucketname $bucketname | where {$_.key -like 'ierter/*' -and $_.StorageClass -like 'Standard' -and $_.lastmodified -like $USDate}