There is a number of different ways to do the selector...
# use an array iterator
@("vol1", "vol2", "vol3") | %{ Get-NcVol -Name $_ } | Get-NcSnapshot .......
# use the "in" operator
Get-NcVol | ?{ $_.Name -in @("vol1", "vol2", "vol3") } | Get-NcSnapshot ........
# using a text file, one volume name per line
Get-Content volumes.txt | %{ Get-NcVol -Name $_ } | Get-NcSnapshot .......
# use a wild card match
Get-NcVol | ?{ $_.Name -like "vol*" } | Get-NcSnapshot .......
# use a wild card exclude
Get-NcVol | ?{ $_.Name -notlike "root*" } | Get-NcSnapshot .........
As for more specific dates, the DateTime object has parameters for all of the date components...year, month, day, hour, minute, etc. If you want to check for "today", for example, you could do this:
# Get snapshots created today
Get-NcSnapshot | ?{ $_.Created.ToShortDateString() -eq (Get-Date).ToShortDateString() }
You could also use relative time periods:
# Get snapshots less than 7 days old
Get-NcSnapshot | ?{ $_.Created -gt (Get-Date).AddDays(-7) }
# Get snapshots more than 7 days old
Get-NcSnapshot | ?{ $_.Created -lt (Get-Date).AddDays(-7) }
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.