diff --git a/object_templates/functions/v4_function.erb b/object_templates/functions/v4_function.erb
index 6b253af69e56fdda53b6f97deae96eb57d82cd4a..684e1c2643a26b4f8e18ee483d8b587dd614f52d 100644
--- a/object_templates/functions/v4_function.erb
+++ b/object_templates/functions/v4_function.erb
@@ -1,8 +1,9 @@
 # frozen_string_literal: true
+<% function_name = name.to_sym.inspect.tr('"', "'") -%>
 <% dispatch_name = name.split(':').last -%>
 
 # https://github.com/puppetlabs/puppet-specifications/blob/master/language/func-api.md#the-4x-api
-Puppet::Functions.create_function(<%= name.to_sym.inspect %>) do
+Puppet::Functions.create_function(<%= function_name %>) do
   dispatch <%= dispatch_name.to_sym.inspect %> do
     param 'Numeric', :a
     return_type 'Numeric'