KohyaSS/examples/test.ps1
2022-12-13 14:59:33 -05:00

6 lines
296 B
PowerShell

$date = Read-Host "Enter the date (yyyy-mm-dd):" -Prompt "Invalid date format. Please try again (yyyy-mm-dd):" -ValidateScript {
# Parse the date input and return $true if it is in the correct format,
# or $false if it is not
$date = [DateTime]::Parse($_)
return $date -ne $null
}