I know that difference between using single quote instead of double quote is that variables aren't expanded.
$a = "hello"
"$a world" # hello world
'$a world' # $a world
I am accustomed to use double quote, but I guess that single quote could be more efficient. Is this always true? Is there some documentation about this topic? I googled a bit but results are overwhelmed by explanation about expanding variables
Efficiency is very probably a non-issue if you don't have embedded variables or subexpressions.
A quick test with Measure-Command
showed no difference at all.
My preference is to use single quotes for anything that doesn't require expansion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With