If you have to escape double quotes in PowerShell strings, the easiest way to do so is to escape them using the "`" (backtick character) in all your strings.
Therefore, if you have a very long string that requires inclusion of double quotes, you will have to include a ` character before the beginning of the string (the 1st double quote) and a final ` character before the final double quote.
Here is an example:
Therefore, if you have a very long string that requires inclusion of double quotes, you will have to include a ` character before the beginning of the string (the 1st double quote) and a final ` character before the final double quote.
Here is an example:
$IISCmd = "Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter `"system.applicationHost/applicationPools`" -name `".`" -value @{name=`"$AppPoolName`";managedRuntimeVersion=`"$AppPoolVersion`"}"
No comments:
Post a Comment