mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Powershell module_utils loader and tests (#26932)
* supports custom module_utils loads (anything in module prefaced with `#Requires -Module Ansible.ModuleUtils.*`) * supports all usual PluginLoader module_utils locations (built-in lib/ansible/module_utils/, custom path from config, playbook module_utils/, ~/.ansible/module_utils, role module_utils, etc), * moves Powershell module_utils from module_utils/powershell.ps1 to module_utils/powershell/Ansible.ModuleUtils.PowerShellLegacy.psm1
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
#!powershell
|
||||
|
||||
#Requires -Module Ansible.ModuleUtils.PowerShellLegacy
|
||||
|
||||
Exit-Json @{ data="success" }
|
||||
@@ -0,0 +1,5 @@
|
||||
#!powershell
|
||||
|
||||
# POWERSHELL_COMMON
|
||||
|
||||
Exit-Json @{ data="success" }
|
||||
@@ -0,0 +1,6 @@
|
||||
#!powershell
|
||||
|
||||
# this should fail
|
||||
#Requires -Module Ansible.ModuleUtils.BogusModule
|
||||
|
||||
Exit-Json @{ data="success" }
|
||||
@@ -0,0 +1,9 @@
|
||||
#!powershell
|
||||
|
||||
# use different cases, spacing and plural of 'module' to exercise flexible powershell dialect
|
||||
#ReQuiReS -ModUleS Ansible.ModuleUtils.PowerShellLegacy
|
||||
#Requires -Module Ansible.ModuleUtils.ValidTestModule
|
||||
|
||||
$o = CustomFunction
|
||||
|
||||
Exit-Json @{data=$o}
|
||||
Reference in New Issue
Block a user