When trying to get files out of an Azure share file directory I'm using powershell code like below (similar to the example from the docs)
$file = Get-AzureStorageFile -Share $fileShare -Path "tolearn\doc" | Get-AzureStorageFile | Where-Object {$_.GetType().Name -eq "CloudFile"}
For example, lets assume we have one child folder and two files under the 'doc' folder. The code from above will return these two files, which is expected.
HoweverLastModified property remains 'null' like it is shown on the picture (as well as other properties)
I need LastModified property in order to filter files that are older than certain date in order to delete them. But, since this value is null, this is not possible. Any idea on how to do this is very much appreciated. Code to do that should look like this:
$file = Get-AzureStorageFile -Share $fileShare -Path "tolearn\doc" | Get-AzureStorageFile | Where-Object { $_.GetType().Name -eq "CloudFile" -and $currentTime -gt $_.Properties.LastModified.AddMinutes($offset)}
Please note, if I query for one file like this, for example
$file = Get-AzureStorageFile -Share $fileShare -Path "tolearn\doc\Word2003.doc"
LastModified property would be properly set. So, it looks like that piped call to the Get-AzureStorageFile method doesn't set these properties to files or directories returned.
Is my approach bad here, is there a better way to filter files in order to delete them from Azure file share?
