예제 #1
0
    def __init__(self, model):
        self.model = model
        self.interpreter = interpreters.PowershellInterpreter()

        assembler_cls = assemblers.get_assembler_cls(model)
        self.model_ast = assembler_cls(model).assemble()

        self._powershell = ("powershell" if platform.system()
                            in ('Windows', 'Microsoft') else "pwsh")
예제 #2
0
def export_to_powershell(model, indent=4):
    """
    Generates a PowerShell code representation of the given model.

    Parameters
    ----------
    model : object
        The model object that should be transpiled into code.
    indent : int, optional
        The size of indents in the generated code.

    Returns
    -------
    code : string
    """
    interpreter = interpreters.PowershellInterpreter(indent=indent)
    return _export(model, interpreter)