WhoIs PowerShell Function

WhoIs PowerShell function will perform a domain name lookup and return information such as domain availability (creation and expiration date),  domain ownership, name servers, etc..

Add this function to a module or save it as ps1 file and dot source it in your profile:

 

facebooktwittergoogle_plus

One thought on “WhoIs PowerShell Function”

  1. I would love to use your function but, I have not been able to get the below code to work (took it down to bare minimums for troubleshooting).

    $domain = “power-shell.com”
    $whois = New-WebServiceProxy -uri “http://www.webservicex.net/whois.asmx?WSDL”
    (($Whois.getwhois(=$domain)).Split(“<<<")[0])

    I get the below errors.

    Missing ')' in method call.
    At C:\Temp\Domain.ps1:4 char:19
    + (($Whois.getwhois( <<<< =$domain)).Split("<<<")[0])
    + CategoryInfo : ParserError: (CloseParenToken:TokenId) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall

    I've tried it with different domain names and quoted around the "=$domain" (like I've seen elsewhere) without improvement. Attempted it on Windows 7 and Windows 10.

    Any help would be appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *