def to_file(type, name)
      file = File.expand_path(options['path'])
      resource_class = parse_type(type)
      client_setup
      resource = resource_class.find_by(@client, name: name).first
      fail_nice "#{resource_class.name.split('::').last} '#{name}' not found" unless resource
      resource.to_file(file, options['format'])
      puts "Output to #{file}"
    rescue SystemCallError => e
      fail_nice "Failed to create file! (You may need to create the necessary directories). Message: #{e}"
    end
def to_file(type, name)
      file = File.expand_path(options['path'])
      resource_class = parse_type(type)
      client_setup
      resource = resource_class.find_by(@client, name: name).first
      fail_nice "#{resource_class.name.split('::').last} '#{name}' not found" unless resource
      resource.to_file(file, options['format'])
      puts "Output to #{file}"
    rescue SystemCallError => e
      fail_nice "Failed to create file! (You may need to create the necessary directories). Message: #{e}"
    end
Save resource details to file