%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/utils/powershell.pyo

�
���^c@@skdZddlmZmZmZddlZddlZddlZej	e
�Zd�Zd�Z
dS(u�
Common functions for working with powershell

.. note:: The PSModulePath environment variable should be set to the default
    location for PowerShell modules. This applies to all OS'es that support
    powershell. If not set, then Salt will attempt to use some default paths.
    If Salt can't find your modules, ensure that the PSModulePath is set and
    pointing to all locations of your Powershell modules.
i(tabsolute_importtprint_functiontunicode_literalsNcC@s
|t�kS(u�
    Check if a module exists on the system.

    Use this utility instead of attempting to import the module with powershell.
    Using powershell to try to import the module is expensive.

    Args:

        name (str):
            The name of the module to check

    Returns:
        bool: True if present, otherwise returns False

    Example:

    .. code-block:: python

        import salt.utils.powershell
        exists = salt.utils.powershell.module_exists('ServerManager')
    (tget_modules(tname((s9/usr/lib/python2.7/site-packages/salt/utils/powershell.pyt
module_existsscC@s�t�}d}g}tjjdtjjd��}djtjjd	d
��}tjjdd�}d
j|�ddj|�dj|�g}dj|�}tjjd|�}|jd�}x0|D](}tjj|�r�|j	|�q�q�W|st
jd�|Sx�|D]�}	tjj|	�s8qnx�t
jjj|	�D]�\}
}}x�|D]�}
tjj|
�\}}|j�|krdtjjtjj|
��}||kr�|j�|j�kr�|2|j	|�q�qdqdWqNWqW|S(u�
    Get a list of the PowerShell modules which are potentially available to be
    imported. The intent is to mimic the functionality of ``Get-Module
    -ListAvailable | Select-Object -Expand Name``, without the delay of loading
    PowerShell to do so.

    Returns:
        list: A list of modules available to Powershell

    Example:

    .. code-block:: python

        import salt.utils.powershell
        modules = salt.utils.powershell.get_modules()
    u.psd1u.psm1u.cdxmlu.xamlu.dlluHOMEuHOMEPATHu{0}\System32uWINDIRu
C:\WindowsuProgramFilesuC:\Program Filesu#{0}/.local/share/powershell/Modulesu#/usr/local/share/powershell/Modulesu#{0}\WindowsPowerShell\v1.0\Modules\u{0}\WindowsPowerShell\Modulesu;uPSModulePathuDefault paths not found(u.psd1u.psm1u.cdxmlu.xamlu.dll(tlisttostenvirontgettformattjointsplittpathtexiststappendtlogterrortisdirtsalttutilstos_walktsplitexttlowertbasenametnormpath(trettvalid_extensionst
root_pathsthome_dirt
system_dirt
program_filest
default_pathstps_module_pathtitemt	root_pathtroot_dirtsub_dirst
file_namest	file_namet	base_nametfile_extensiontdir_name((s9/usr/lib/python2.7/site-packages/salt/utils/powershell.pyR.s@	!


%
(t__doc__t
__future__RRRtloggingRtsalt.utils.pathRt	getLoggert__name__RRR(((s9/usr/lib/python2.7/site-packages/salt/utils/powershell.pyt<module>
s	

Zerion Mini Shell 1.0