Installing Modules with a JSON file in PowerShell ModuleManager

With the PowerShell ModuleManager 2022 release, we have added the ability to install a list of modules from a file. This feature is helpful if you need to install multiple modules at once or if you are moving from a particular computer to another machine. 

The file needs to be in JSON format, like the following:

{
	"Modules":[
		{
			"Name": "Carbon",
			"Version": "2.10.2"
		},
		{
			"Name": "Az.Accounts",
			"Version": "2.5.3"
		},
		{
			"Name":"PowerShellGet",
			"Version":null
		},
		{
			"Name":"PackageManagement",
			"Version":null
		}	
	]	
}

The module name is required for each module to be installed. If the version is not specified, the latest version will be installed. The modules will be installed from the repository set in Options for the selected machine.

Export Module List

You can generate a JSON file by selecting from the listed modules and then clicking Export Module List (Home->Installed) from the ribbon:

If a selected module has multiple versions installed and a specific version is not selected, a version will not be specified in the generated JSON file.

Configure Import

You can load an exported JSON file from the File menu. Locate the file on your computer and then select the Start button:

The specified modules will be installed on the selected machine—remote or local—and any output will be written to the Log pane:

Feedback

Please continue providing your feedback. Many of the new features included in the service builds are suggestions from users like you. Submit your suggestions or feature requests on the Wish List and Feature Requests forum or the Feature Requests page.