Single-quoted strings

Multi-word strings can be surrounded by single quotation marks, 'like this'.

For example:

if $autoupdate {
  notice('autoupdate parameter has been deprecated and replaced with package_ensure.  Set this to latest for the same behavior as autoupdate => true.')
}

Line breaks within the string are interpreted as literal line breaks.

Single-quoted strings can’t interpolate values.

Escape sequences

The following escape sequences are available in single-quoted strings:

SequenceResult
\\Single backslash
\'Literal single quotation mark
Within single quotation marks, if a backslash is followed by any character other than another backslash or a single quotation mark, Puppet treats it as a literal backslash.

To include a literal double backslash use a quadruple backslash.

To include a backslash at the very end of a single-quoted string, use a double backslash instead of a single backslash. For example: path => 'C:\Program Files(x86)\\'

A good habit is to always use two backslashes where you want the result to be one backslash. For example, path => 'C:\\Program Files(x86)\\'