�
�Udac @` s� d d l m Z m Z m Z e Z d Z d d l Z d d l Z d d l Z d d l
Z
d d l Z d d l j
j Z d d l Z d d l m Z d d l m Z m Z d d l m Z d d d d
d g Z d d
� Z d e f d � � YZ d S( i ( t absolute_importt divisiont print_functions_
name: powershell
plugin_type: shell
version_added: historical
short_description: Windows PowerShell
description:
- The only option when using 'winrm' or 'psrp' as a connection plugin.
- Can also be used when using 'ssh' as a connection plugin and the C(DefaultShell) has been configured to PowerShell.
extends_documentation_fragment:
- shell_windows
N( t AnsibleError( t to_bytest to_text( t ShellBaset
PowerShells
-NoProfiles -NonInteractives -ExecutionPolicyt Unrestrictedt Errorc
C` s� g } x� | r� | j d � d } | | j d � | !} | | } t j | � } t j d | j � } | r d | j d � n d } | j d | � } | j g | D]3 } | j j
d � | k r� | j j d
d � ^ q� � q Wt
d j | � � S( s�
Takes a byte string like '#< CLIXML
<Objs...' and extracts the stream
message encoded in the XML data. CLIXML is used by PowerShell to encode
multiple objects in stderr.
s </Objs>i s <Objs s {(.*)}s {%s}i t s ./%sSt St _x000D__x000A_s
( t findt ETt
fromstringt ret matcht tagt groupt findallt extendt attribt gett textt replaceR t join(
t datat streamt linest end_idxt current_elementt clixmlt namespace_matcht namespacet stringst e( ( sD /usr/lib/python2.7/site-packages/ansible/plugins/shell/powershell.pyt
_parse_clixml# s
Kt ShellModulec B` s
e Z e � Z d Z d Z d Z e Z e � Z
e j d � Z
d � Z d � Z d � Z d � Z d � Z d � Z d
� Z d � Z d � Z e d
� Z d e d d d � Z d d � Z d � Z d � Z d d � Z d � Z d � Z d � Z! e e e d � Z"