1.

You Have A Script Which Uses Read-host To Prompt The User For An Ip Address. You Need To Make Sure The User Inputs A Valid Ip Address. How Would You Do That ?

Answer»

A GOOD candidate would probably USE one of 2 ways :

  • SPLITTING the address in 4 elements and try to cast them to a [byte]
  • A regular expression

A great candidate would use the much simpler and more robust method : let the .NET Framework do the hard WORK and just try to cast the input string to the [System.Net.IPAddress] class.

By the way, the candidate should KNOW that what we get from Read-Host is a [string].

A good candidate would probably use one of 2 ways :

A great candidate would use the much simpler and more robust method : let the .NET Framework do the hard work and just try to cast the input string to the [System.Net.IPAddress] class.

By the way, the candidate should know that what we get from Read-Host is a [string].



Discussion

No Comment Found