Why is Resolve-DnsName not recognized for PowerShell Core? So far as I recall it works fine with PowerShell itself.

Is this a .NET versus dotnet problem? That dotnet simply doesn't have this functionality?

thufir@dur:~/powershell/webservicex$ dotnet --version
thufir@dur:~/powershell/webservicex$ ./dns.ps1 
Resolve-DnsName : The term 'Resolve-DnsName' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At /home/thufir/powershell/webservicex/dns.ps1:3 char:1
+ Resolve-DnsName -Name localhost -Type ANY | Format-Table -AutoSize
+ ~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Resolve-DnsName:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

thufir@dur:~/powershell/webservicex$ cat dns.ps1 
#!/usr/bin/pwsh -Command

Resolve-DnsName -Name localhost -Type ANY | Format-Table -AutoSize


see closed question also, and technet.


From the What's New In PowerShell Core 6.0 documentation, in the "Backwards Compatibility" section:

Most of the modules that ship as part of Windows (for example, DnsClient, Hyper-V, NetTCPIP, Storage, etc.) and other Microsoft products including Azure and Office have not been explicitly ported to .NET Core yet. The PowerShell team is working with these product groups and teams to validate and port their existing modules to PowerShell Core. With .NET Standard and CDXML, many of these traditional Windows PowerShell modules do seem to work in PowerShell Core, but they have not been formally validated, and they are not formally supported.

While Powershell Core is GA, it is still very much a work in progress.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.