ansible-collections / community.windows

Windows community collection for Ansible
https://galaxy.ansible.com/community/windows
GNU General Public License v3.0
198 stars 153 forks source link

win_psmodule - Fix missing AcceptLicense #488

Closed jborean93 closed 1 year ago

jborean93 commented 1 year ago
SUMMARY

The act of installing the pre-reqs would load PackageManagement and PowerShellGet at the older versions. As PackageManagement is implemented as a binary module once the dll has been loaded it cannot be unloaded. This causes problems later on when a newer parameter like -AcceptLicense is specified but the older PackageManagement does not have it.

To solve this the pre-reqs are installed in a sub process so that when this module imports it for the first time it will be at the version needed.

Fixes https://github.com/ansible-collections/community.windows/issues/487

ISSUE TYPE
COMPONENT NAME

win_psmodule