mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
win_exec: refactor PS exec runner (#45334)
* win_exec: refactor PS exec runner * more changes for PSCore compatibility * made some changes based on the recent review * split up module exec scripts for smaller payload * removed C# module support to focus on just error msg improvement * cleaned up c# test classifier code
This commit is contained in:
parent
aa2f3edb49
commit
e972287c35
34 changed files with 2751 additions and 1676 deletions
22
lib/ansible/executor/powershell/module_script_wrapper.ps1
Normal file
22
lib/ansible/executor/powershell/module_script_wrapper.ps1
Normal file
|
@ -0,0 +1,22 @@
|
|||
# (c) 2018 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][System.Collections.IDictionary]$Payload
|
||||
)
|
||||
|
||||
#AnsibleRequires -Wrapper module_wrapper
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-AnsibleLog "INFO - starting module_script_wrapper" "module_script_wrapper"
|
||||
|
||||
$script = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Payload.module_entry))
|
||||
|
||||
# get the common module_wrapper code and invoke that to run the module
|
||||
$entrypoint = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($payload.module_wrapper))
|
||||
$entrypoint = [ScriptBlock]::Create($entrypoint)
|
||||
|
||||
&$entrypoint -Scripts $script -Environment $Payload.environment -ModuleName "script"
|
||||
|
||||
Write-AnsibleLog "INFO - ending module_script_wrapper" "module_script_wrapper"
|
Loading…
Add table
Add a link
Reference in a new issue