PowerShell string interpolation syntax
问题 I always used the following syntax to be sure that variable were expanded in a string: "my string with a $($variable)" I recently ran into the following syntax: "my string with a ${variable}" Are they equivalent? Any difference? 回答1: To complement marsze's helpful answer: ${...} (enclosing the variable name in { and } ) is indeed always necessary if a variable name contains special characters (such as spaces or . ) In the context of string expansion (interpolation) inside "..." , there is