通过Puppet 3.0设置Powershell执行策略
我正在尝试使用Puppet 3.0为powershell 2.0设置执行策略,方法如下通过Puppet 3.0设置Powershell执行策略,powershell,puppet,Powershell,Puppet,我正在尝试使用Puppet 3.0为powershell 2.0设置执行策略,方法如下 exec { 'rolesfeatures1': command => 'C:\Windows\System32\cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe Invoke-Command {Set-ExecutionPolicy RemoteSigned}', provider => windows, l
exec { 'rolesfeatures1':
command => 'C:\Windows\System32\cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe Invoke-Command {Set-ExecutionPolicy RemoteSigned}',
provider => windows,
logoutput => true,
}
或
我不熟悉木偶,但试试这个:
command => 'C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -Command {Set-ExecutionPolicy RemoteSigned}'
或
我不熟悉木偶,但试试这个:
command => 'C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -Command {Set-ExecutionPolicy RemoteSigned}'
或
感谢您的回复,我想用sysnative代替System32解决了这个问题
exec {'executionpolicy':
path => 'C:\Windows\sysnative\WindowsPowerShell\v1.0', #Puppet redirects to SysWOW64 by default
command => 'Powershell.exe -Command "& {Set-ExecutionPolicy Unrestricted}"',
logoutput => true
}
感谢您的回复,我想用sysnative代替System32解决了这个问题
exec {'executionpolicy':
path => 'C:\Windows\sysnative\WindowsPowerShell\v1.0', #Puppet redirects to SysWOW64 by default
command => 'Powershell.exe -Command "& {Set-ExecutionPolicy Unrestricted}"',
logoutput => true
}
我认为它实际上不适用于我exec{'rolesfeatures1':command=>C:\Windows\System32\windowswowershell\v1.0\Powershell.exe-command“&{Set ExecutionPolicy RemoteSigned-Force}”,provider=>Windows,logoutput=>true,}我认为它实际上不适用于我exec{'RoleFeatures1':command=>C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe-command“&{Set-ExecutionPolicy RemoteSigned-Force}”,provider=>Windows,logoutput=>true,}