# Escape a string literal value to be included as an argument to powershell.exe.
# This will help in cases where one might need to use & as in PowerShell this is
# a reserved character whereas in cmd.exe this is used to indicate the start
# of an additional command to execute.
#
# Example (without this escaping):
# powershell -Command "cmd /c echo hello & echo world" <- This will result in errors as & is a reserved character.
# powershell -Command "cmd.exe /c 'echo hello & echo world'" <- This will succeed as & is interpreted as part of a string by PowerShell.
#
# In our case we use PowerShell quoting as described at https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.3
# which states that to use a single quote inside of a single quoted string, use a second consecutive single quote.
# Therefore this is valid in PowerShell: 'don''t'
# Which in turn becomes the string "don't" (sans double quotes) inside PowerShell.
#
# @param string [String] The string to escape for use with powershell.exe.