ajout script
This commit is contained in:
parent
2d25000938
commit
434b6c4b17
|
@ -0,0 +1,19 @@
|
|||
#Script créé par Nicolas Lang - Sous licence CC-BY-SA
|
||||
#https://nicolaslang.fr
|
||||
|
||||
$today = Get-Date
|
||||
$cible = [datetime]"12/16/2016"
|
||||
|
||||
$feries = @([datetime]"01/01",[datetime]"05/01",[datetime]"05/08",[datetime]"07/14",[datetime]"08/15",[datetime]"11/1",[datetime]"11/11",[datetime]"12/25")
|
||||
$feries += @([datetime]"04/21/2014",[datetime]"05/29/2014",[datetime]"06/09/2014",[datetime]"04/06/2015",[datetime]"05/14/2015",[datetime]"05/25/2015")
|
||||
#ajoutez les jours qui sont fériés en conservant cette syntaxe
|
||||
$joursouvres = 1
|
||||
while ($today.ToLongDateString() -ne $cible.ToLongDateString())
|
||||
{
|
||||
if (($today.DayOfWeek -ne "Sunday") -and ($today.DayOfWeek -ne "Saturday") -and ($feries.tolongdatestring() -notcontains $today.tolongdatestring()))
|
||||
{
|
||||
$joursouvres++
|
||||
}#fin if
|
||||
$today = $today.AddDays(1)
|
||||
}#fin while
|
||||
Write-Host $joursouvres "jour(s) ouvré(s), aujourd'hui inclus"
|
Loading…
Reference in New Issue
Block a user