File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/win_dsc.cpython-310.pyc
o
�N�g0n � @ s� d Z ddlZddlZddlZddlZddlZddlmZm Z e�
e�ZdZ
dd� Zd d d
�Z d!dd
�Z d!dd�Zd"dd�Zdd� Zd#dd�Zdd� Zdd� Zdd� Zdd� Z d$dd�ZdS )%a�
Module for working with Windows PowerShell DSC (Desired State Configuration)
This module is Alpha
This module applies DSC Configurations in the form of PowerShell scripts or
MOF (Managed Object Format) schema files.
Use the ``psget`` module to manage PowerShell resources.
The idea is to leverage Salt to push DSC configuration scripts or MOF files to
the Minion.
:depends:
- PowerShell 5.0
� N)�CommandExecutionError�SaltInvocationErrorZdscc C sd t jj�� s
t�d� dS td d�} | d st�d� dS t jj�| d d d
�r0t�d� dS t S )
z8
Set the system module of the kernel is Windows
�&DSC: Only available on Windows systems)Fr zcmd.shell_info�
powershellZ installed�DSC: Requires PowerShell)Fr �version�<z5.0�#DSC: Requires PowerShell 5 or later)Fr )
�salt�utils�platformZ
is_windows�log�debug�__salt__ZversionsZcompare�__virtualname__)Zpowershell_info� r �H/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/win_dsc.py�__virtual__! s
r � Fc C s� d| � � vr
| � d|� �} t�d| � td | d|d|d�}d|v r%|d= d |vs/|d d
kr8td| � �|d��|d
dkrBd|d
<