Puppet 3.0 Powershell 2.0 Set ExecutionPolicy Err
2012-Oct-09 16:58 UTC
[Puppet Users] Setting Powershell execution policy through Puppet
Hi,
I am trying to set the execution policy on the Powershell 64 bit version.
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,
}
or
exec { ''rolesfeatures1'':
command =>
''C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe
Invoke-Command {Set-ExecutionPolicy RemoteSigned}'',
provider => windows,
logoutput => true,
}
Both recipes do not work but when i execute the same command on the cmd
windows works just fine. Any clues?
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/cqynD9TtAR4J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Josh Cooper
2012-Oct-09 17:53 UTC
Re: [Puppet Users] Setting Powershell execution policy through Puppet
On Tue, Oct 9, 2012 at 9:58 AM, Puppet 3.0 Powershell 2.0 Set ExecutionPolicy Err <lmayorga1980@gmail.com> wrote:> Hi, > > I am trying to set the execution policy on the Powershell 64 bit version. > > > 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, > } > > or > > exec { ''rolesfeatures1'': > command => ''C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe > Invoke-Command {Set-ExecutionPolicy RemoteSigned}'', > provider => windows, > logoutput => true, > } > > Both recipes do not work but when i execute the same command on the cmd > windows works just fine. Any clues? > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/cqynD9TtAR4J. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.Since ruby is a 32-bit process, Windows will automatically redirect file system access from C:\Windows\System32 to C:\Windows\SysWOW64. Use C:\Windows\sysnative in your path instead. See http://docs.puppetlabs.com/windows/running.html#file-system-redirection-in-64-bit-windows-versions and the very end of http://docs.puppetlabs.com/windows/troubleshooting.html#error-messages Josh -- Josh Cooper Developer, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Marco Parra D.
2012-Oct-12 15:46 UTC
Re: [Puppet Users] Setting Powershell execution policy through Puppet
Hi,
You could try this:
$powerShell =
''C:\\Windows\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe
-ExecutionPolicy remotesigned''
exec {''Install-service'' :
command => "${PowerShell} -File
D:\\Powershell-Scripts\\scripts\\script.ps1",
path => ''C:\windows\System32'',
require =>
File[''D:\Powershell-Scripts\scripts\script.ps1''],
}
This works for us..
Regards.
On 09-10-2012 13:58, Puppet 3.0 Powershell 2.0 Set ExecutionPolicy Err
wrote:> Hi,
>
> I am trying to set the execution policy on the Powershell 64 bit version.
>
>
> 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,
> }
>
> or
>
> exec { ''rolesfeatures1'':
> command =>
''C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe
> Invoke-Command {Set-ExecutionPolicy RemoteSigned}'',
> provider => windows,
> logoutput => true,
> }
>
> Both recipes do not work but when i execute the same command on the
> cmd windows works just fine. Any clues?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/cqynD9TtAR4J.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.