Ask Your Question
1

Powershell provider is running a 32-bit PS

asked 2014-05-16 09:32:05 -0500

rafal ammado gravatar image

updated 2014-09-15 14:44:11 -0500

According to the documentation, the powershell provider is intended to run 64-bit ( despite ruby being 32-bit) For some reason when i exec the following it executes it against 32-bit

Does anyone know what i am doing wrong here

System info:

Windows Server 2012 Standard 
System type: 64-bit

This is my class:

class os_config{
  exec { 'install telnet client':
    command   => '[IntPtr]::Size; Import-Module servermanager; Add-WindowsFeature telnet-client',
    provider  => powershell,
    logoutput => true,
  }
}

and how i run it

C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\bin>puppet apply -v
    -l C:\os.log C:\ProgramData\PuppetLabs\puppet\etc\modules\os_manifest.pp

The log:

Puppet (warning): Could not retrieve fact fqdn
Puppet (notice): Compiled catalog for ip-0a011032 in environment production in 0.59 seconds
Puppet (info): Applying configuration version '1400250442'

/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): **4**

/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): Import-Module : The specified module 'servermanager' was not loaded because no
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): valid module file was found in any module directory.
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): At line:1 char:17
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): + [IntPtr]::Size; Import-Module servermanager; Add-WindowsFeature telnet-client
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):     + CategoryInfo          : ResourceUnavailable: (servermanager:String) [Imp
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):    ort-Module], FileNotFoundException
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):     + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Comm
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):    ands.ImportModuleCommand
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): Add-WindowsFeature : The term 'Add-WindowsFeature' is not recognized as the
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): name of a cmdlet, function, script file, or operable program. Check the
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): spelling of the name, or if a path was included, verify that the path is
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): correct and try again.
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): At line:1 char:46
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): + [IntPtr]::Size; Import-Module servermanager; Add-WindowsFeature telnet-client
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice): +                                              ~~~~~~~~~~~~~~~~~~
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):     + CategoryInfo          : ObjectNotFound: (Add-WindowsFeature:String) [],
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):    CommandNotFoundException
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):     + FullyQualifiedErrorId : CommandNotFoundException
/Stage[main]/Os_config/Exec[install telnet client]/returns (notice):
Puppet (err): [IntPtr]::Size; Import-Module servermanager; Add-WindowsFeature telnet-client returned 1 instead of one of [0]
/Stage[main]/Os_config/Exec[install telnet client]/returns (err): change from notrun to 0 failed: [IntPtr]::Size; Import-Module servermanager; Add-WindowsFeature telnet-client returned 1 instead of one of [0]
Puppet (notice): Finished catalog run in 6.02 seconds
edit retag flag offensive close merge delete

Comments

It sure would be useful if you would use the code formatting on code blocks, and output. It is basically unreadable right now.

zoredache gravatar imagezoredache ( 2014-05-16 12:06:47 -0500 )edit

I'll keep that in mind. Somebody has done it already tho. Thanks Stefan !

rafal ammado gravatar imagerafal ammado ( 2014-05-19 04:25:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-09-15 11:58:06 -0500

joshc gravatar image

Please update your powershell module. There was a bug in earlier versions that prevented it from executing the 64-bit version of powershell. The latest version is 1.0.3 from https://forge.puppetlabs.com/puppetla... .

Also, for puppet 3.7, we released a 64-bit version of puppet, to eliminate issues caused by Windows file system redirection. See https://docs.puppetlabs.com/puppet/la...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-05-16 09:32:05 -0500

Seen: 715 times

Last updated: Sep 15 '14