I am trying to speed up our profile script’s load times by installing all the modules that we use in our scripts for all users so that they are not needed every time we load up powershell. However, when I try to install the module, it says that it does not exist. When I try to find the module using Find-Module “dns”, it just comes back with xDnsServer. The modules I am trying to install are ActiveDirectory, PSDiagnostics, TroubleshootingPack, WDS, dnsclient, dnsserver, and dhcpserver. All of these modules produce the same result as shown below. Am I misunderstanding how modules work in powershell? Or am I messing up my usage of repositories? Any help or pointers would be appreciated.
Thanks!
[pre]
PS C:\windows\system32> Import-Module dnsclient -Verbose
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\dnsclient.psd1’.
VERBOSE: Loading ‘TypesToProcess’ from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\DnsCmdlets.Types.ps1xml’.
VERBOSE: Loading ‘TypesToProcess’ from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\DnsConfig.Types.ps1xml’.
VERBOSE: Loading ‘TypesToProcess’ from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\DnsClientPSProvider.Types.ps1xml’.
VERBOSE: Loading ‘FormatsToProcess’ from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\DnsCmdlets.Format.ps1xml’.
VERBOSE: Loading ‘FormatsToProcess’ from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\DnsConfig.Format.ps1xml’.
VERBOSE: Loading ‘FormatsToProcess’ from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\DnsClientPSProvider.Format.ps1xml’.
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\dnslookup.dll’.
VERBOSE: Importing cmdlet ‘Resolve-DnsName’.
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\MSFT_DnsClient.cdxml’.
VERBOSE: Importing function ‘Get-DnsClient’.
VERBOSE: Importing function ‘Register-DnsClient’.
VERBOSE: Importing function ‘Set-DnsClient’.
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\MSFT_DnsClientCache.cdxml’.
VERBOSE: Importing function ‘Clear-DnsClientCache’.
VERBOSE: Importing function ‘Get-DnsClientCache’.
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\MSFT_DnsClientGlobalSetting.cdxml’.
VERBOSE: Importing function ‘Get-DnsClientGlobalSetting’.
VERBOSE: Importing function ‘Set-DnsClientGlobalSetting’.
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\MSFT_DnsClientServerAddress.cdxml’.
VERBOSE: Importing function ‘Get-DnsClientServerAddress’.
VERBOSE: Importing function ‘Set-DnsClientServerAddress’.
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\PS_DnsClientNrptPolicy_v1.0.0.cdxml’.
VERBOSE: Importing function ‘Get-DnsClientNrptPolicy’.
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\PS_DnsClientNRPTGlobal_v1.0.0.cdxml’.
VERBOSE: Importing function ‘Get-DnsClientNrptGlobal’.
VERBOSE: Importing function ‘Set-DnsClientNrptGlobal’.
VERBOSE: Loading module from path ‘C:\windows\system32\WindowsPowerShell\v1.0\Modules\dnsclient\PS_DnsClientNRPTRule_v1.0.0.cdxml’.
VERBOSE: Importing function ‘Add-DnsClientNrptRule’.
VERBOSE: Importing function ‘Get-DnsClientNrptRule’.
VERBOSE: Importing function ‘Remove-DnsClientNrptRule’.
VERBOSE: Importing function ‘Set-DnsClientNrptRule’.
VERBOSE: Exporting function ‘Get-DnsClient’.
VERBOSE: Exporting function ‘Register-DnsClient’.
VERBOSE: Exporting function ‘Set-DnsClient’.
VERBOSE: Exporting function ‘Clear-DnsClientCache’.
VERBOSE: Exporting function ‘Get-DnsClientCache’.
VERBOSE: Exporting function ‘Get-DnsClientGlobalSetting’.
VERBOSE: Exporting function ‘Set-DnsClientGlobalSetting’.
VERBOSE: Exporting function ‘Get-DnsClientServerAddress’.
VERBOSE: Exporting function ‘Set-DnsClientServerAddress’.
VERBOSE: Exporting function ‘Get-DnsClientNrptPolicy’.
VERBOSE: Exporting function ‘Get-DnsClientNrptGlobal’.
VERBOSE: Exporting function ‘Set-DnsClientNrptGlobal’.
VERBOSE: Exporting function ‘Add-DnsClientNrptRule’.
VERBOSE: Exporting function ‘Get-DnsClientNrptRule’.
VERBOSE: Exporting function ‘Remove-DnsClientNrptRule’.
VERBOSE: Exporting function ‘Set-DnsClientNrptRule’.
VERBOSE: Exporting cmdlet ‘Resolve-DnsName’.
VERBOSE: Importing cmdlet ‘Resolve-DnsName’.
VERBOSE: Importing function ‘Add-DnsClientNrptRule’.
VERBOSE: Importing function ‘Clear-DnsClientCache’.
VERBOSE: Importing function ‘Get-DnsClient’.
VERBOSE: Importing function ‘Get-DnsClientCache’.
VERBOSE: Importing function ‘Get-DnsClientGlobalSetting’.
VERBOSE: Importing function ‘Get-DnsClientNrptGlobal’.
VERBOSE: Importing function ‘Get-DnsClientNrptPolicy’.
VERBOSE: Importing function ‘Get-DnsClientNrptRule’.
VERBOSE: Importing function ‘Get-DnsClientServerAddress’.
VERBOSE: Importing function ‘Register-DnsClient’.
VERBOSE: Importing function ‘Remove-DnsClientNrptRule’.
VERBOSE: Importing function ‘Set-DnsClient’.
VERBOSE: Importing function ‘Set-DnsClientGlobalSetting’.
VERBOSE: Importing function ‘Set-DnsClientNrptGlobal’.
VERBOSE: Importing function ‘Set-DnsClientNrptRule’.
VERBOSE: Importing function ‘Set-DnsClientServerAddress’.
PS C:\windows\system32> Install-Module -Name dnsclient -AllowClobber -AcceptLicense -Scope AllUsers -Verbose
VERBOSE: Using the provider ‘PowerShellGet’ for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider ‘NuGet’.
VERBOSE: The specified Location is ‘https://www.powershellgallery.com/api/v2/’ and PackageManagementProvider is ‘NuGet’.
VERBOSE: Searching repository ‘<updated>2022-09-01T08:30:14Z</updated><link rel="self" href="https://www.powershellgallery.com/api/v2/Packages" /><author><name /></author></feed>’ for ‘’.
VERBOSE: Total package yield:‘0’ for the specified package ‘dnsclient’.
PackageManagement\Install-Package : No match was found for the specified search criteria and module name ‘dnsclient’. Try Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.0.3\PSModule.psm1:9550 char:21
- … $null = PackageManagement\Install-Package @PSBoundParameters
-
- CategoryInfo : ObjectNotFound: (Microsoft.Power…InstallPackage:InstallPackage) [Install-Package], Exception
- FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
[/pre]