class Chef::Resource::PowershellScript

Public Class Methods

new(name, run_context=nil) click to toggle source
Calls superclass method Chef::Resource::WindowsScript.new
# File lib/chef/resource/powershell_script.rb, line 26
def initialize(name, run_context=nil)
  super(name, run_context, :powershell_script, "powershell.exe")
  @convert_boolean_return = false
end

Protected Class Methods

get_default_attributes(opts) click to toggle source

Allow callers evaluating guards to request default attribute values. This is needed to allow #convert_boolean_return to be true in guard context by default, and false by default otherwise. When this mode becomes the default for this resource, this method can be removed since guard context and recipe resource context will have the same behavior.

# File lib/chef/resource/powershell_script.rb, line 48
def self.get_default_attributes(opts)
  {:convert_boolean_return => true}
end

Public Instance Methods

convert_boolean_return(arg=nil) click to toggle source
# File lib/chef/resource/powershell_script.rb, line 31
def convert_boolean_return(arg=nil)
  set_or_return(
    :convert_boolean_return,
    arg,
    :kind_of => [ FalseClass, TrueClass ]
  )
end