# Powershell Provider

**URL:** <https://discourse.chef.io/t/powershell-provider/2856>\
**Category:** Chef Infra (archive)\
**Created:** [June 21, 2012, 11:14pm UTC](https://discourse.chef.io/t/powershell-provider/2856 "2012-06-21T23:14:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Johnson](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@Bryan\_Johnson](https://discourse.chef.io/u/Bryan_Johnson)\
**Post date:** [June 21, 2012, 11:14pm UTC](https://discourse.chef.io/t/powershell-provider/2856/1 "2012-06-21T23:14:45Z")

</div>

I’m running Chef 10.12.0 on Windows 2008 R2. Using the powershell cookbook  
1.0.6 I get a failure complaining about umask being an undefined method. Any  
guidance is appreciated.

[2012-06-21T16:10:54-07:00] INFO: Processing powershell[DiskPart] action run  
(AN::DiskPart line /chef/cache/cookbooks/AN/recipes/DiskPart.rb)  
[2012-06-21T16:10:54-07:00] ERROR: powershell[DiskPart] (AN::DiskPart line  
/chef/cache/cookbooks/AN/recipes/DiskPart.rb) has had an error  
[2012-06-21T16:10:54-07:00] ERROR: powershell[DiskPart]  
(c:/chef/cache/cookbooks/AN/recipes/DiskPart.rb:21:in `from_file') had an error:powershell[DiskPart] (AN::DiskPart line /chef/cache/cookbooks/AN/recipes/DiskPart.rb) had an error: NoMethodError: undefined method`umask’ for Chef::Resource::Powershell  
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:148:in  
`method_missing' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/execute.rb:51:in`action\_run’  
c:/chef/cache/cookbooks/powershell/libraries/core.rb:68:in `action_run' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:454:in`run\_action’  
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:49:in  
`run_action' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in`block (2 levels) in converge’  
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in  
`each' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in`block in converge’

---

<div class="post-metadata">

**Author:** ![David\_Leaver](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/david_leaver/32/705_2.png) [@David\_Leaver](https://discourse.chef.io/u/David_Leaver)\
**Post date:** [July 5, 2012, 2:32am UTC](https://discourse.chef.io/t/powershell-provider/2856/2 "2012-07-05T02:32:52Z")

</div>

Just looking at upgrading our nodes to the latest chef from around 0.10.6/8 somewhere and ran in to this.

My fix was to add:

attribute :umask, :kind\_of =\> String

to powershell/resources/default.rb line 34.

This probably needs a fix in the powershell provider or chef, Seth would probably know best.

Cheers,  
Dave.

-----Original Message-----  
From: [bryan.johnson@activenetwork.com](mailto:bryan.johnson@activenetwork.com) [[mailto:bryan.johnson@activenetwork.com](mailto:bryan.johnson@activenetwork.com)]  
Sent: Friday, 22 June 2012 11:15 a.m.  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Powershell Provider

I’m running Chef 10.12.0 on Windows 2008 R2. Using the powershell cookbook  
1.0.6 I get a failure complaining about umask being an undefined method. Any  
guidance is appreciated.

[2012-06-21T16:10:54-07:00] INFO: Processing powershell[DiskPart] action run (AN::DiskPart line /chef/cache/cookbooks/AN/recipes/DiskPart.rb)  
[2012-06-21T16:10:54-07:00] ERROR: powershell[DiskPart] (AN::DiskPart line  
/chef/cache/cookbooks/AN/recipes/DiskPart.rb) has had an error [2012-06-21T16:10:54-07:00] ERROR: powershell[DiskPart] (c:/chef/cache/cookbooks/AN/recipes/DiskPart.rb:21:in `from_file') had an error:powershell[DiskPart] (AN::DiskPart line /chef/cache/cookbooks/AN/recipes/DiskPart.rb) had an error: NoMethodError: undefined method`umask’ for Chef::Resource::Powershell C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:148:in  
`method_missing' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/execute.rb:51:in`action\_run’  
c:/chef/cache/cookbooks/powershell/libraries/core.rb:68:in `action_run' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/resource.rb:454:in`run\_action’  
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:49:in  
`run_action' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in`block (2 levels) in converge’  
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in  
`each' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/runner.rb:85:in`block in converge’
