Windows和Powershell配方的傀儡

Windows和Powershell配方的傀儡,powershell,puppet,recipe,Powershell,Puppet,Recipe,我正在尝试在puppet recipes中设置一些powershell内联cmdlet,以便安装其他msi包和powershell脚本 class ps{ #http://docs.puppetlabs.com/windows/running.html exec {'executionpolicy': path => 'C:\Windows\sysnative\WindowsPowerShell\v1.0', command =>

我正在尝试在puppet recipes中设置一些powershell内联cmdlet,以便安装其他msi包和powershell脚本

class ps{
    #http://docs.puppetlabs.com/windows/running.html

    exec {'executionpolicy':
        path => 'C:\Windows\sysnative\WindowsPowerShell\v1.0', 
        command => 'Powershell.exe "Set-ExecutionPolicy Unrestricted -Force -Verbose"',
        logoutput => true
        }

    exec {'psremoting':
        path => 'C:\Windows\sysnative\WindowsPowerShell\v1.0', 
        command => 'Powershell.exe "Enable-PSRemoting -Force -Verbose"',
        logoutput => true,
        require => Exec["executionpolicy"]
        } 
    exec {'psmemory':
        path => 'C:\Windows\sysnative\WindowsPowerShell\v1.0', 
        command => 'Powershell.exe "Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 2048"',
        logoutput => true,
        require => [Exec["psremoting"],Exec["executionpolicy"]]
    }
}
我遇到了不同的错误,我正在考虑更改方法,并将这些内联cmdlet添加到.ps1脚本中。关于将powershell内联脚本作为傀儡配方运行,有什么建议吗


谢谢。

您可以使用此powershell傀儡模块来帮助您


这会更好地工作

您可以使用此powershell puppet模块来帮助您

这个效果更好