Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.
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

@VerdonTrigance

Description

@VerdonTrigance
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions