Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

The term 'PSModule' is not recognized as the name of a cmdlet #42

Open
VerdonTrigance opened this issue Jul 31, 2020 · 0 comments
Open

Comments

@VerdonTrigance
Copy link

PS C:\Windows\system32> Get-InstalledModule PackageManagement

Version              Name                                Repository           Description                                                                                                                                                                    
-------              ----                                ----------           -----------                                                                                                                                                                    
1.4.7                PackageManagement                   PSGallery            PackageManagement (a.k.a. OneGet) is a new way to discover and install software packages from around the web....                                                               

Configuration PSModulesConfig
{
	Import-DscResource -ModuleName 'PSDesiredStateConfiguration'	
	Import-DscResource -ModuleName @{ModuleName="PackageManagement"; RequiredVersion="1.4.7"}

	Node $AllNodes.NodeName {
		foreach ($moduleName in $Node.Modules) {		
			PSModule $moduleName {				
            	Name = $moduleName
				Ensure = "Present"
				InstallationPolicy = "Trusted"
			}
		}
	}
}
PSModulesConfig -OutputPath $OutputPath -ConfigurationData "$PSScriptRoot\ConfigurationData.psd1"

Resulting to:

PSDesiredStateConfiguration\Node : The term 'PSModule' 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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant