On the Internet saw three test development of the pen questions, the answer is in Python solution. This is the time to learn about PowerShell, practice:)
1. Verify the mailbox format
2. Get the suffix name of the URL
3. Get the time of the previous day or the previous second
My solution is:
1 #Check Email Format2Write-host"Please input your email address"3 $email=read-Host4 $regular="[A-za-z0-9]\@[a-za-z0-9]\. [A-za-z0-9]"5 if($email -match $regular)6{Write-host"Email is correct, pass!"-Foregroundcolor Green7}Else{8Write-host"Email is wrong, waring!"-Foregroundcolor Red9 }Ten One #------------------------------------------------------------- A - #Get the URL name extensions -Write-host"Please input one URL" the $url=read-Host - $extension=($url. Substring ($url. LastIndexOf (".") +1)) -Write-host"The URL extension is:" $extension-Foregroundcolor Green - + #------------------------------------------------------------ - + #Get the previous time A $Now=get-Date at $Now. AddDays (-1)#Yesterday - $Now. AddSeconds (-1)#previous Second
Come on! 2017!
Thanks,
Litao
-----Published on Tuesday, November 4:09:35 PM---
Using PowerShell to solve three-way test development pen Questions