How do I put all of the below I have into one line so the user is able to enter at once?
So, instead of it popping up with a Read-Host every time they want to enter something in – it pops up once and states what you want to enter the date as..
So – “Please enter in FULL Date with time – ie 25 Oct 2012 9:00”
Also – if someone enters in a weird character, how do I let it error out?
$Day = $(Read-Host "Enter day of month")
if ($Day -eq ''){$Day = Get-Date -format dd}
$Month = $(Read-Host "Enter Month of Year")
if ($Month -eq ""){$Month = Get-Date -format MM}
$Year = $(Read-Host "Enter Year")
if ($Year -eq "") {$Year = Get-Date -format yy}
$Hour = $(Read-Host "Enter Hour")
if ($Hour -eq "") {$Hour = Get-Date -Format HH}
$Minute = $(Read-Host "Enter Minute")
if ($Minute -eq "") {$Minute = Get-Date -Format mm}
$Second = $(Read-Host "Enter Hour")
if ($Second -eq "") {$Second = Get-Date -Format ss}
You can do something like this: