관리-도구
편집 파일: psrp.cpython-39.pyc
a �����)gɌ������������������� ���@���sv��d�dl�mZmZmZ�eZdZd�dlZd�dlZd�dl Z d�dl Z d�dlmZ �d�dlmZmZ�d�dlmZ�d�dlmZ�d�dlmZmZmZ�d�d lmZ�d�d lmZ�d�dlmZ�d�dlmZ�d Z dZ!zpd�dl"Z"d�dl#m$Z$m%Z%m&Z&�d�dl'm(Z(m)Z)�d�dl*m+Z+m,Z,�d�dl-m.Z.m/Z/�d�dl0m1Z1m2Z2�d�dl3m4Z4m5Z5�W�n.�e6�yZ�Z7�zdZ e7Z!W�Y�dZ7[7n dZ7[70�0�e��Z8G�dd��de�Z9dS�)�����)�absolute_import�division�print_functiona^$�� author: Ansible Core Team name: psrp short_description: Run tasks over Microsoft PowerShell Remoting Protocol description: - Run commands or put/fetch on a target via PSRP (WinRM plugin) - This is similar to the I(winrm) connection plugin which uses the same underlying transport but instead runs in a PowerShell interpreter. version_added: "2.7" requirements: - pypsrp>=0.4.0 (Python library) extends_documentation_fragment: - connection_pipelining options: # transport options remote_addr: description: - The hostname or IP address of the remote host. default: inventory_hostname type: str vars: - name: inventory_hostname - name: ansible_host - name: ansible_psrp_host remote_user: description: - The user to log in as. type: str vars: - name: ansible_user - name: ansible_psrp_user keyword: - name: remote_user remote_password: description: Authentication password for the C(remote_user). Can be supplied as CLI option. type: str vars: - name: ansible_password - name: ansible_winrm_pass - name: ansible_winrm_password aliases: - password # Needed for --ask-pass to come through on delegation port: description: - The port for PSRP to connect on the remote target. - Default is C(5986) if I(protocol) is not defined or is C(https), otherwise the port is C(5985). type: int vars: - name: ansible_port - name: ansible_psrp_port keyword: - name: port protocol: description: - Set the protocol to use for the connection. - Default is C(https) if I(port) is not defined or I(port) is not C(5985). choices: - http - https type: str vars: - name: ansible_psrp_protocol path: description: - The URI path to connect to. type: str vars: - name: ansible_psrp_path default: 'wsman' auth: description: - The authentication protocol to use when authenticating the remote user. - The default, C(negotiate), will attempt to use C(Kerberos) if it is available and fall back to C(NTLM) if it isn't. type: str vars: - name: ansible_psrp_auth choices: - basic - certificate - negotiate - kerberos - ntlm - credssp default: negotiate cert_validation: description: - Whether to validate the remote server's certificate or not. - Set to C(ignore) to not validate any certificates. - I(ca_cert) can be set to the path of a PEM certificate chain to use in the validation. choices: - validate - ignore default: validate type: str vars: - name: ansible_psrp_cert_validation ca_cert: description: - The path to a PEM certificate chain to use when validating the server's certificate. - This value is ignored if I(cert_validation) is set to C(ignore). type: path vars: - name: ansible_psrp_cert_trust_path - name: ansible_psrp_ca_cert aliases: [ cert_trust_path ] connection_timeout: description: - The connection timeout for making the request to the remote host. - This is measured in seconds. type: int vars: - name: ansible_psrp_connection_timeout default: 30 read_timeout: description: - The read timeout for receiving data from the remote host. - This value must always be greater than I(operation_timeout). - This option requires pypsrp >= 0.3. - This is measured in seconds. type: int vars: - name: ansible_psrp_read_timeout default: 30 version_added: '2.8' reconnection_retries: description: - The number of retries on connection errors. type: int vars: - name: ansible_psrp_reconnection_retries default: 0 version_added: '2.8' reconnection_backoff: description: - The backoff time to use in between reconnection attempts. (First sleeps X, then sleeps 2*X, then sleeps 4*X, ...) - This is measured in seconds. - The C(ansible_psrp_reconnection_backoff) variable was added in Ansible 2.9. type: int vars: - name: ansible_psrp_connection_backoff - name: ansible_psrp_reconnection_backoff default: 2 version_added: '2.8' message_encryption: description: - Controls the message encryption settings, this is different from TLS encryption when I(ansible_psrp_protocol) is C(https). - Only the auth protocols C(negotiate), C(kerberos), C(ntlm), and C(credssp) can do message encryption. The other authentication protocols only support encryption when C(protocol) is set to C(https). - C(auto) means means message encryption is only used when not using TLS/HTTPS. - C(always) is the same as C(auto) but message encryption is always used even when running over TLS/HTTPS. - C(never) disables any encryption checks that are in place when running over HTTP and disables any authentication encryption processes. type: str vars: - name: ansible_psrp_message_encryption choices: - auto - always - never default: auto proxy: description: - Set the proxy URL to use when connecting to the remote host. vars: - name: ansible_psrp_proxy type: str ignore_proxy: description: - Will disable any environment proxy settings and connect directly to the remote host. - This option is ignored if C(proxy) is set. vars: - name: ansible_psrp_ignore_proxy type: bool default: 'no' # auth options certificate_key_pem: description: - The local path to an X509 certificate key to use with certificate auth. type: path vars: - name: ansible_psrp_certificate_key_pem certificate_pem: description: - The local path to an X509 certificate to use with certificate auth. type: path vars: - name: ansible_psrp_certificate_pem credssp_auth_mechanism: description: - The sub authentication mechanism to use with CredSSP auth. - When C(auto), both Kerberos and NTLM is attempted with kerberos being preferred. type: str choices: - auto - kerberos - ntlm default: auto vars: - name: ansible_psrp_credssp_auth_mechanism credssp_disable_tlsv1_2: description: - Disables the use of TLSv1.2 on the CredSSP authentication channel. - This should not be set to C(yes) unless dealing with a host that does not have TLSv1.2. default: no type: bool vars: - name: ansible_psrp_credssp_disable_tlsv1_2 credssp_minimum_version: description: - The minimum CredSSP server authentication version that will be accepted. - Set to C(5) to ensure the server has been patched and is not vulnerable to CVE 2018-0886. default: 2 type: int vars: - name: ansible_psrp_credssp_minimum_version negotiate_delegate: description: - Allow the remote user the ability to delegate it's credentials to another server, i.e. credential delegation. - Only valid when Kerberos was the negotiated auth or was explicitly set as the authentication. - Ignored when NTLM was the negotiated auth. type: bool vars: - name: ansible_psrp_negotiate_delegate negotiate_hostname_override: description: - Override the remote hostname when searching for the host in the Kerberos lookup. - This allows Ansible to connect over IP but authenticate with the remote server using it's DNS name. - Only valid when Kerberos was the negotiated auth or was explicitly set as the authentication. - Ignored when NTLM was the negotiated auth. type: str vars: - name: ansible_psrp_negotiate_hostname_override negotiate_send_cbt: description: - Send the Channel Binding Token (CBT) structure when authenticating. - CBT is used to provide extra protection against Man in the Middle C(MitM) attacks by binding the outer transport channel to the auth channel. - CBT is not used when using just C(HTTP), only C(HTTPS). default: yes type: bool vars: - name: ansible_psrp_negotiate_send_cbt negotiate_service: description: - Override the service part of the SPN used during Kerberos authentication. - Only valid when Kerberos was the negotiated auth or was explicitly set as the authentication. - Ignored when NTLM was the negotiated auth. default: WSMAN type: str vars: - name: ansible_psrp_negotiate_service # protocol options operation_timeout: description: - Sets the WSMan timeout for each operation. - This is measured in seconds. - This should not exceed the value for C(connection_timeout). type: int vars: - name: ansible_psrp_operation_timeout default: 20 max_envelope_size: description: - Sets the maximum size of each WSMan message sent to the remote host. - This is measured in bytes. - Defaults to C(150KiB) for compatibility with older hosts. type: int vars: - name: ansible_psrp_max_envelope_size default: 153600 configuration_name: description: - The name of the PowerShell configuration endpoint to connect to. type: str vars: - name: ansible_psrp_configuration_name default: Microsoft.PowerShell N)� constants)�AnsibleConnectionFailure�AnsibleError)�AnsibleFileNotFound)�boolean)�to_bytes� to_native�to_text)�ConnectionBase)�_common_args)�Display)�sha1T)�GenericComplexObject�PSInvocationState�RunspacePoolState)�AuthenticationError� WinRMError)�PSHost�PSHostUserInterface)� PowerShell�RunspacePool)�WSMan�AUTH_KWARGS)�ConnectionError�ConnectTimeoutFc�����������������������s����e�Zd�ZdZdZdZdZdZ��fdd�Z��fdd�Z d d ��Z d��fdd � Z��fdd�Z��fdd�Z dd��Zdd��Zddd�Zdd��Z���ZS�)� ConnectionZpsrp)z.ps1z.exe��FTc��������������������sz���d|�_�d|�_d�|�_d�|�_d|�_d|�_tt|��j|i�|���t j svt�d�� tj��t�d�� tj��t�d�� tj��d�S�)NTFZ powershell�pypsrpZrequests_credsspZurllib3)Zalways_pipeline_modulesZhas_native_async�runspace�host�_last_pipelineZ_shell_type�superr����__init__�CZ DEFAULT_DEBUG�loggingZ getLoggerZsetLevelZWARNING�INFO)�self�args�kwargs�� __class__���C/usr/lib/python3.9/site-packages/ansible/plugins/connection/psrp.pyr%���\��s����zConnection.__init__c�������������� ������st��t�stdtt����tt|������|�����tj d|�j |�j|�jf�|�jd��|�j �sptf�i�|�j��}t��}td�d�ddd�|d��|�_t||�j|�jd�|�_ tjd|�j|�j|jjf�|�jd��z|�j ����W�n��ty��}�ztdt|����W�Y�d�}~nvd�}~0��t�y*�}�ztd t|����W�Y�d�}~nBd�}~0��ttf�yb�}�ztd t|����W�Y�d�}~n d�}~0�0�d|�_d�|�_ |�S�)Nz,pypsrp or dependencies are not installed: %sz7ESTABLISH PSRP CONNECTION FOR USER: %s ON PORT %s TO %s�r"���FzAnsible PSRP Host)r"����configuration_namez8PSRP OPEN RUNSPACE: auth=%s configuration=%s endpoint=%sz*failed to authenticate with the server: %sz0psrp connection failure during runspace open: %sz*Failed to connect to the host via PSRP: %sT)!� HAS_PYPSRPr���r����PYPSRP_IMP_ERRr$���r����_connect� _build_kwargs�display�vvv� _psrp_user� _psrp_port� _psrp_hostr!���r����_psrp_conn_kwargsr���r���r"���r����_psrp_configuration_name�vvvvv� _psrp_auth� transportZendpoint�openr���r���r���r���r���� _connectedr#���)r)���� connectionZhost_ui�er,���r.���r/���r4���l��sd�����������������zConnection._connectc�������������� ���C���sv���|�j�sd�|�_d�S�z|�����W�n6�tyR�}�zt�dt|����W�Y�d�}~n d�}~0�0�tjd|�jd��d�|�_|�� ���d�S�)Nz*PSRP reset - failed to closed runspace: %szPSRP: Reset Connectionr0���) rA���r!����close� Exceptionr6����debugr���r=���r:���r4���)r)���rC���r.���r.���r/����reset���s����(zConnection.resetNc��������������������s����t�t|��j|||d��|�d�t�d��r�t�|�d�d��}t |d�}t |ddd�}|r�|�d �r�t |���d �dd����}td|���|�j �d d d �}||kr�t�d��q�tjd|�|�jd��n t d|��}tjd|�|�jd��|��||�\}} } || | fS�)N)�in_data�sudoable� z -EncodedCommand���z utf-16-le�surrogate_or_strictZpassthru)�errors� nonstringz#!r�������z=cannot run the interpreter '%s' on the psrp connection pluginr���z!PSRP: EXEC (via pipeline wrapper)z PSRP: EXEC %sr0���z%s exit $LASTEXITCODE)r$���r����exec_command� startswith�joinr����base64� b64decode�splitr���r���� splitlinesr����_shellZbuild_module_commandr6���r7���r:����_exec_psrp_script)r)����cmdrH���rI���Z b_command�scriptZinterpreterZbootstrap_wrapper�rc�stdout�stderrr,���r.���r/���rP������s(����� �zConnection.exec_commandc��������������������s*��t�t��������j����tjd��f��jd��d}t�j j jd�d�d���t���t �dd���tj����s�td t������������fd d�}�j||���gd�\}}}|d kr�tt|���t�t|��}����} |�d�} | �stdt|�t|�f���| | k�s&tdt| �t| �f���d�S�)NzPUT %s TO %sr0���a���begin { $ErrorActionPreference = "Stop" $WarningPreference = "Continue" $path = $MyInvocation.UnboundArguments[0] $fd = [System.IO.File]::Create($path) $algo = [System.Security.Cryptography.SHA1CryptoServiceProvider]::Create() $bytes = @() $bindingFlags = [System.Reflection.BindingFlags]'NonPublic, Instance' Function Get-Property { <# .SYNOPSIS Gets the private/internal property specified of the object passed in. #> Param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [System.Object] $Object, [Parameter(Mandatory=$true, Position=1)] [System.String] $Name ) $Object.GetType().GetProperty($Name, $bindingFlags).GetValue($Object, $null) } Function Set-Property { <# .SYNOPSIS Sets the private/internal property specified on the object passed in. #> Param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [System.Object] $Object, [Parameter(Mandatory=$true, Position=1)] [System.String] $Name, [Parameter(Mandatory=$true, Position=2)] [AllowNull()] [System.Object] $Value ) $Object.GetType().GetProperty($Name, $bindingFlags).SetValue($Object, $Value, $null) } Function Get-Field { <# .SYNOPSIS Gets the private/internal field specified of the object passed in. #> Param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [System.Object] $Object, [Parameter(Mandatory=$true, Position=1)] [System.String] $Name ) $Object.GetType().GetField($Name, $bindingFlags).GetValue($Object) } # MaximumAllowedMemory is required to be set to so we can send input data that exceeds the limit on a PS # Runspace. We use reflection to access/set this property as it is not accessible publicly. This is not ideal # but works on all PowerShell versions I've tested with. We originally used WinRS to send the raw bytes to the # host but this falls flat if someone is using a custom PS configuration name so this is a workaround. This # isn't required for smaller files so if it fails we ignore the error and hope it wasn't needed. # https://github.com/PowerShell/PowerShell/blob/c8e72d1e664b1ee04a14f226adf655cced24e5f0/src/System.Management.Automation/engine/serialization.cs#L325 try { $Host | Get-Property 'ExternalHost' | ` Get-Field '_transportManager' | ` Get-Property 'Fragmentor' | ` Get-Property 'DeserializationContext' | ` Set-Property 'MaximumAllowedMemory' $null } catch {} } process { $bytes = [System.Convert]::FromBase64String($input) $algo.TransformBlock($bytes, 0, $bytes.Length, $bytes, 0) > $null $fd.Write($bytes, 0, $bytes.Length) } end { $fd.Close() $algo.TransformFinalBlock($bytes, 0, 0) > $null $hash = [System.BitConverter]::ToString($algo.Hash).Replace('-', '').ToLowerInvariant() Write-Output -InputObject "{`"sha1`":`"$hash`"}" } �R�����������rL����rM���z#file or module does not exist: "%s"c������������������3���s����d}�t��d�����t���fdd�d�D�]P}t|�}|�|7�}���|��tjd��|�|f��jd��t�|�}t |�gV��q$|�dkr�dgV��W�d�����n1�s�0����Y��d�S�) Nr����rbc����������������������s ���������S�)N)�readr.���)�buffer_size�src_fdr.���r/����<lambda>F�������z7Connection.put_file.<locals>.read_gen.<locals>.<lambda>rg���z%PSRP PUT %s to %s (offset=%d, size=%dr0���r���) r@����iter�len�updater6���r=���r:���rS���Z b64encoder���)�offsetZb_dataZdata_lenZb64_data�Z b_in_pathrd����in_path�out_pathr)���Z sha1_hash)re���r/����read_genB��s���� � z%Connection.put_file.<locals>.read_gen)� argumentsr���r���z8Remote sha1 was not returned, stdout: '%s', stderr: '%s'z0Remote sha1 hash %s does not match local hash %s)r$���r����put_filerW����_unquoter6���r7���r:����intr!���rB����max_payload_sizer���r ����os�path�existsr���r���rX���r����json�loadsr���Z hexdigest�get)r)���rm���rn���Zcopy_scriptro���r[���r\���r]���Z put_outputZ local_sha1Zremote_sha1r,���rl���r/���rq������s0����b � �zConnection.put_filec��������������������s���t�t|���||��tjd||f�|�jd��|�j�|�}|�dd�}t |�j jj|�j jjd�d���}||d��}d|�j� |�|f�}d }|�j|d d�\}}} |dkr�td |t| �f���n|���dkr�d�S�t|dd�} d}t| d���}tjd|||f�|�jd��|��||��\}}} |dk�r0td|t| �f���t�|����} |�| ��t| �|k��rZ�qh|t| �7�}q�|��d�\}}} |dk�r�t�d|t| �f���W�d�����n1��s�0����Y��d�S�)NzFETCH %s TO %sr0����\�/r_���r`���i���a���$ErrorActionPreference = "Stop" $path = '%s' if (Test-Path -Path $path -PathType Leaf) { $fs = New-Object -TypeName System.IO.FileStream -ArgumentList @( $path, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::Read ) $buffer_size = %d } elseif (Test-Path -Path $path -PathType Container) { Write-Output -InputObject "[DIR]" } else { Write-Error -Message "$path does not exist" $host.SetShouldExit(1) }aU��$ErrorActionPreference = "Stop" $fs.Seek(%d, [System.IO.SeekOrigin]::Begin) > $null $buffer = New-Object -TypeName byte[] -ArgumentList $buffer_size $bytes_read = $fs.Read($buffer, 0, $buffer_size) if ($bytes_read -gt 0) { $bytes = $buffer[0..($bytes_read - 1)] Write-Output -InputObject ([System.Convert]::ToBase64String($bytes)) }F��use_local_scoper���z.failed to setup file stream for fetch '%s': %sz[DIR]rL���ra����wbzPSRP FETCH %s to %s (offset=%dz#failed to transfer file to '%s': %sz$fs.Close()z3failed to close remote file stream of file '%s': %s)r$���r���� fetch_filer6���r7���r:���rW���rr����replacers���r!���rB���rt����_escaperX���r���r����stripr ���r@���r=���rS���rT����writeri����warning)r)���rm���rn���Zmax_b64_sizerd���Zsetup_scriptZread_scriptr[���r\���r]���Z b_out_pathrk���Zout_file�datar,���r.���r/���r����f��s\����� ��� ��� � �zConnection.fetch_filec�����������������C���sL���|�j�r6|�j�jtjkr6tjd|�j�j�|�jd��|�j�����d�|�_�d|�_ d�|�_ d�S�)NzPSRP CLOSE RUNSPACE: %sr0���F)r!����stater���ZOPENEDr6���r=����idr:���rD���rA���r#���)r)���r.���r.���r/���rD������s����� zConnection.closec�����������������C���sn��|���d�|�_|���d�|�_|���d�|�_|���d�}|���d�}|d�u�rR|d�u�rRd}d}n6|d�u�rpt|�dkrjdnd }n|d�u�r�|dkr�dnd}||�_t|�|�_|���d �|�_|���d�|�_|���d�}|���d �}|dkr�d|�_ n|d�ur�||�_ nd|�_ |���d�|�_ |���d�|�_|���d�|�_|���d�|�_ t|���d��|�_t|���d��|�_t|���d��|�_|���d�|�_t|���d��|�_t|���d��|�_|���d�|�_|���d�|�_|���d�|�_|���d�|�_|���d�|�_|���d �|�_|���d!�|�_|���d"�|�_|���d#�|�_g�}t� ��D�]}|�!|���q�d$d%��|���d&�D��}|�"|�}|D�]} t#�$d'| ����q"t%|�j|�j|�j|�j|�jdk|�j|�j|�j |�j |�j|�j |�j|�j|�j|�j|�j|�j|�j|�j|�j|�j|�j|�jd(�|�_&t't(d)��r�d*t(j)v��r�|�j|�j&d<�n|�jd�u�r�t#�$d+��t't(d)��rd,t(j)v��r|�j|�j&d<�|�j|�j&d<�n,|�jd�u�r&t#�$d-��|�jd�u�r<t#�$d.��|�*|�D�]"} |���d&�d/| ��} | |�j&| <��qFd�S�)0NZremote_addrZremote_userZremote_password�protocol�port�httpsib��ia���httprv����auth�cert_validationZca_cert�ignoreFT�connection_timeoutZread_timeoutZmessage_encryption�proxyZignore_proxy�operation_timeout�max_envelope_sizer1���Zreconnection_retriesZreconnection_backoff�certificate_key_pem�certificate_pem�credssp_auth_mechanism�credssp_disable_tlsv1_2�credssp_minimum_version�negotiate_send_cbt�negotiate_delegate�negotiate_hostname_override�negotiate_servicec�����������������S���s���h�|�]}|��d�d��qS�)Z ansible_psrp_r���)r����)�.0�vr.���r.���r/���� <setcomp>���rg���z+Connection._build_kwargs.<locals>.<setcomp>Z_extraszDansible_psrp_%s is unsupported by the current psrp version installed)Zserverr�����username�passwordZsslrv���r����r����r����Z encryptionr����Zno_proxyr����r����r����r����r����r����r����r����r����r����r�����FEATURESZwsman_read_timeoutz�ansible_psrp_read_timeout is unsupported by the current psrp version installed, using ansible_psrp_connection_timeout value for read_timeout instead.Zwsman_reconnectionszWansible_psrp_reconnection_retries is unsupported by the current psrp version installed.zWansible_psrp_reconnection_backoff is unsupported by the current psrp version installed.zansible_psrp_%s)+Z get_optionr:���r8���Z _psrp_passrs���Z_psrp_protocolr9���Z _psrp_pathr>���Z_psrp_cert_validationZ_psrp_connection_timeoutZ_psrp_read_timeoutZ_psrp_message_encryptionZ_psrp_proxyr ���Z_psrp_ignore_proxyZ_psrp_operation_timeoutZ_psrp_max_envelope_sizer<���Z_psrp_reconnection_retries�floatZ_psrp_reconnection_backoffZ_psrp_certificate_key_pemZ_psrp_certificate_pemZ_psrp_credssp_auth_mechanismZ_psrp_credssp_disable_tlsv1_2Z_psrp_credssp_minimum_versionZ_psrp_negotiate_send_cbtZ_psrp_negotiate_delegateZ!_psrp_negotiate_hostname_overrideZ_psrp_negotiate_servicer����values�extend� differencer6���r�����dictr;����hasattrr ���r�����intersection)r)���r����r����r����Zcert_trust_pathZsupported_argsZ auth_kwarg� extra_argsZunsupported_args�arg�optionr.���r.���r/���r5������s����� � � zConnection._build_kwargsc����������� ������C���s|���|�j�r tj|�j�_|�j�����d�|�_�t|�j�}|j||d��|rP|D�]}|�|��q@|j |d��|�� |�\}}} ||�_�||| fS�)Nr}���)�input)r#���r���ZRUNNINGr�����stopr���r!���Z add_script�add_argumentZinvoke�_parse_pipeline_result) r)���rZ���Z input_datar~���rp���Zpsr����r[���r\���r]���r.���r.���r/���rX���%��s���� zConnection._exec_psrp_scriptc�����������������C���s��|�j�jp|jrdnd}g�}|jD�]�}t|t�r�|jdu�r�|j}|j� ��D�]\}}|� d||f���qH|j� ��D�]\}}|� d||f���qnd�|�}nt |dd�}|� |��q t|�j�jj�dkr�||�j�jj7�}d�|�} g�} |jjD�]z}|jr�d |j�nd }|j�rd|j�nd } d|t|�| |j|jf�}|j}tjd k�rT|du�rT|d|�7�}| � |��q�t|�j�jj�dk�r�| |�j�jj7�} d�dd��| D���}tjd|�|�jd��tjd| �|�jd��tjd|�|�jd��d|�j�_g�|�j�j_g�|�j�j_|t| dd�t|dd�fS�)a}�� PSRP doesn't have the same concept as other protocols with its output. We need some extra logic to convert the pipeline streams and host output into the format that Ansible understands. :param pipeline: The finished PowerShell pipeline that invoked our commands :return: rc, stdout, stderr based on the pipeline output ����r���Nz%s: %s� Z simplerepr)rN���z z%s : r���z%s zJ%s%s %s + CategoryInfo : %s + FullyQualifiedErrorId : %sr`���z StackTrace: %sc�����������������S���s���g�|�]}t�|��qS�r.���)r���)r�����or.���r.���r/���� <listcomp>v��rg���z5Connection._parse_pipeline_result.<locals>.<listcomp>zPSRP RC: %dr0���zPSRP STDOUT: %szPSRP STDERR: %szutf-8)�encoding)r"���r[���Z had_errors�output� isinstancer���Z to_stringZ property_setsZadapted_properties�items�appendZextended_propertiesrR���r���ri���Zuir\���Zstreams�error�command_nameZinvocation_position_message�str�messageZfq_errorZscript_stacktracer6���� verbosityr]���r=���r:���r ���)r)���Zpipeliner[���Zstdout_listr����Z obj_lines�key�valueZ output_msgr\���Zstderr_listr����r����ZpositionZ error_msgZ stacktracer]���r.���r.���r/���r����?��sL���� �� z!Connection._parse_pipeline_result)NT)NTN)�__name__� __module__�__qualname__r?���Z!module_implementation_preferencesZallow_executableZhas_pipeliningZallow_extrasr%���r4���rG���rP���rq���r����rD���r5���rX���r����� __classcell__r.���r.���r,���r/���r���T��s ���/'�N h r���):Z __future__r���r���r����typeZ __metaclass__Z DOCUMENTATIONrS���rx���r'���ru���Zansibler���r&���Zansible.errorsr���r���r���Z)ansible.module_utils.parsing.convert_boolr ���Zansible.module_utils._textr ���r���r���Zansible.plugins.connectionr ���Z ansible.plugins.shell.powershellr���Zansible.utils.displayr���Zansible.utils.hashingr���r2���r3���r ���Zpypsrp.complex_objectsr���r���r���Zpypsrp.exceptionsr���r���Zpypsrp.hostr���r���Zpypsrp.powershellr���r���Zpypsrp.wsmanr���r���Zrequests.exceptionsr���r����ImportError�errr6���r���r.���r.���r.���r/����<module>���s@�����/