7 responses to “PowerShell dig (nslookup) Cmdlet!”

  1. Lance Robinson

    You can also do this with the get-dns cmdlet that is included in NetCmdlets.

    NetCmdlets has a free hobbyist license listed on its sales page too.

  2. seaJhawk

    thanks joel!

    i’m sure ‘somebody’ is very happy that you did this!

    - somebody

  3. seaJhawk

    I’m having some issues on PS1 with the install. After running the install script I don’t see any new snapins or the get-dns cmdlet.

    I’ve pasted the results of the install here and the contents of the _installed.InstallLog file follows.

    PS C:\toolbox\Scripts\dlls> .\install-poshnet.ps1 .\poshnet.dll
    Microsoft® .NET Framework Installation utility Version 2.0.50727.1434
    Copyright© Microsoft Corporation. All rights reserved.

    The uninstall is beginning.
    See the contents of the log file for the C:\toolbox\Scripts\dlls\_installed.dll assembly’s progress.
    The file is located at C:\toolbox\Scripts\dlls\_installed.InstallLog.
    Uninstalling assembly ‘C:\toolbox\Scripts\dlls\_installed.dll’.
    Affected parameters are:
    logtoconsole =
    assemblypath = C:\toolbox\Scripts\dlls\_installed.dll
    showcallstack =
    logfile = C:\toolbox\Scripts\dlls\_installed.InstallLog

    The uninstall has completed.
    Microsoft® .NET Framework Installation utility Version 2.0.50727.1434
    Copyright© Microsoft Corporation. All rights reserved.

    Running a transacted installation.

    Beginning the Install phase of the installation.
    See the contents of the log file for the C:\toolbox\Scripts\dlls\_installed.dll assembly’s progress.
    The file is located at C:\toolbox\Scripts\dlls\_installed.InstallLog.
    Installing assembly ‘C:\toolbox\Scripts\dlls\_installed.dll’.
    Affected parameters are:
    logtoconsole =
    assemblypath = C:\toolbox\Scripts\dlls\_installed.dll
    showcallstack =
    logfile = C:\toolbox\Scripts\dlls\_installed.InstallLog

    The Install phase completed successfully, and the Commit phase is beginning.
    See the contents of the log file for the C:\toolbox\Scripts\dlls\_installed.dll assembly’s progress.
    The file is located at C:\toolbox\Scripts\dlls\_installed.InstallLog.
    Committing assembly ‘C:\toolbox\Scripts\dlls\_installed.dll’.
    Affected parameters are:
    logtoconsole =
    assemblypath = C:\toolbox\Scripts\dlls\_installed.dll
    showcallstack =
    logfile = C:\toolbox\Scripts\dlls\_installed.InstallLog

    The Commit phase completed successfully.

    The transacted install has completed.
    PS C:\toolbox\Scripts\dlls> Get-PSSnapin

    Name : Microsoft.PowerShell.Core
    PSVersion : 1.0
    Description : This Windows PowerShell snap-in contains Windows PowerShell management cmdlets used to manage components of Windows
    PowerShell.

    Name : Microsoft.PowerShell.Host
    PSVersion : 1.0
    Description : This Windows PowerShell snap-in contains cmdlets used by the Windows PowerShell host.

    Name : Microsoft.PowerShell.Management
    PSVersion : 1.0
    Description : This Windows PowerShell snap-in contains management cmdlets used to manage Windows components.

    Name : Microsoft.PowerShell.Security
    PSVersion : 1.0
    Description : This Windows PowerShell snap-in contains cmdlets to manage Windows PowerShell security.

    Name : Microsoft.PowerShell.Utility
    PSVersion : 1.0
    Description : This Windows PowerShell snap-in contains utility Cmdlets used to manipulate data.

    PS C:\toolbox\Scripts\dlls> gcm dns -commandType cmdlet

    Nothing Returned

    trimmed by Jaykul ;)
  4. seaJhawk

    That worked great!

    And amazingly, you managed to do something that the big boys (err… other big boys) can’t seem to do – you provided one snapin that works in both 32-bit and 64-bit PowerShell. I’m not sure if you intended to do that or not, but explaining it would sure make a great blog post because there are a lot of folks out there who need some help.

    You Rock!
    -Chris