KohyaSS/examples/test.ps1

6 lines
296 B
PowerShell
Raw Normal View History

2022-12-13 19:59:33 +00:00
$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
}