There are multiple .webp files in a project folder. Some .webps are the original picture and some function as thumbnail (their size is different). The used naming convention is: original files are just called NAME.webp and tumbnails are NAME-thumb.webp. I am trying to create a Powershell script that returns all the -thumb.webp files based on the original files creation date. So, if the original files was created today, return the corresponding -thumb.webp (they have the same basename apart from the -thumb
This is what I tried so far, but something is still off:
$webps = (Get-ChildItem -Path $dir -Filter '*.webp' -File | Where-Object { $_.CreationTime -gt $refdate }).BaseName
$output = Get-ChildItem -Path $dir -Filter '*.webp' -File | Where-Object { $webps -contains ($_.BaseName + "-thumb") }