1
我試圖在木偶食譜中設置一些PowerShell內聯cmdlet,以便安裝其他msi軟件包和PowerShell腳本。用於Windows和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內聯腳本作爲傀儡配方運行的建議?
謝謝。
http://forge.puppetlabs.com/joshcooper/powershell – mikeslattery