Initialize-Module

1.1

This function ensures that specified PowerShell modules are installed, up-to-date, and imported for use.
It handles necessary prerequisites for PowerShell Gallery interaction, including:
- Setting the security protocol to TLS 1.2.
- Ensuring the NuGet package provider is available.
- Installing/updating and importing the 'Microsoft.PowerShell.PSResourceGet' module for
This function ensures that specified PowerShell modules are installed, up-to-date, and imported for use.
It handles necessary prerequisites for PowerShell Gallery interaction, including:
- Setting the security protocol to TLS 1.2.
- Ensuring the NuGet package provider is available.
- Installing/updating and importing the 'Microsoft.PowerShell.PSResourceGet' module for modern gallery operations.

For each module specified by the -Name parameter, the function will:
1. Attempt to install or update it to the latest version from the PowerShell Gallery. Modules are typically installed for AllUsers.
2. Import the module into the current session.

This automates the common tasks required to make PowerShell modules ready for use.

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Initialize-Module -RequiredVersion 1.1

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Package Details

Author(s)

  • Jonathan Pitre

Tags

PowerShell Module Automation

Dependencies

This script has no dependencies.

Release Notes

1.1 - 2025-06-16
Added log file and transcript.
Added log path and file parameters.
1.0 - 2025-05-30
Initial release.

FileList

Version History

Version Downloads Last updated
1.3 170 6/20/2025
1.2 96 6/17/2025
1.1 (current version) 19 6/17/2025
1.0 142 5/30/2025