RosettaCodeData/Task/Inverted-syntax/PowerShell/inverted-syntax-2.psh

9 lines
218 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
function Action ([scriptblock]$Expression, [Alias("if")][bool]$Test)
{
if ($Test) {&$Expression}
}
Set-Alias -Name say -Value Action
say {"Thank God it's Friday!"} -if (Get-Date 5/27/2016).DayOfWeek -eq "Friday"