FileMAsk

Advertisement

Mathieu.Thomas
Joined:
Posts:
1
Location:
France

FileMAsk

Hello I would like to know if there is a mask to download all the files from last month.

I have this, but it's not for a whole month...


$transferOptions.FileMask = "*> = 30D"

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,390
Location:
Prague, Czechia

Re: FileMAsk

You are in PowerShell, you have full "power" of that language:

$lastMonth = (Get-Date).AddMonths(-1)
$firstDayOfLastMonth =
    Get-Date -Year $lastMonth.Year -Month $lastMonth.Month -Day 1
$timestamp = $firstDayOfLastMonth.ToString("yyyy-MM-dd")
$filemask = "*>=" + $timestamp
 
$transferOptions.FileMask = $filemask

Reply with quote

Advertisement

You can post new topics in this forum