ncooper09
ncooper09

Reputation: 113

Is it possible to delete or overwrite cmdlets?

I'm working with DNS resource records in Powershell 5 using code that I inherited from the guy who was trying to do this before me. The cmdlet I am trying to use is Add-DnsServerResourceRecordA.

Part of his code has import-module certain folder\PowerShell\Modules\DnsServer. The weird thing is, it seems like as I was trying bits and pieces of the code earlier, I was able to use the add-DNSblah cmdlet. Now, after It ried running the whole script including the import-module, Powershell is saying that the cmdlet does not exist natively, and when I import the module and run it it is giving me Add-DnsServerResourceRecordA: Invalid Class.

It is my understanding that Add-DnsServerResourceRecordA should be included in my normal Powershell 5.0. Could that Import-Module have permanently damaged PS somehow? Why else would the cmdlet not show up, even in a Get-Command "dns"?

Upvotes: 1

Views: 302

Answers (1)

sodawillow
sodawillow

Reputation: 13176

I'm pretty sure you will need the Remote Server Administration Tools (RSAT) installed to have these cmdlets available on a non-server Windows OS.

You can download them from this page: https://www.microsoft.com/en-gb/download/details.aspx?id=45520.

Not really sure why the Import-Module does not fail if the DNSServer module is not present on the system.

If RSAT are already installed, you can try to reinstall them.

Upvotes: 2

Related Questions