Collections:
Other Resources:
Variable Expansion in Strings in Windows PowerShell
What is variable expansion in strings in Windows PowerShell?
✍: FYIcenter.com
Variable expansion in strings is a short-hand of string concatenation operations using the following syntax rule:
When a variable is included in a double-quoted string literal like "... $variable ...", it will be replaced with the string representation of the variable value.
In other words, the following two expressions are identical:
"Leading text $var trailing text." "Leading text "+$var+" trailing text."
Remember, if you want to keep $var as 3 characters instead of a variable, you need to use the $ sign escape sequence. Here is a good example of using variable expansion in a string:
PS C:\fyicenter> $name = "John" PS C:\fyicenter> Write-Host "Value of `$name: $name" Value of $name: John
⇒ Expression Expansion in Strings in Windows PowerShell
⇐ String Concatenation in Windows PowerShell
2016-10-20, 1943🔥, 0💬
Popular Posts:
How do I move the licenses for the tracks that I ripped from CDs to my new computer? Typically, lice...
I have a problem wiht the Drivers Video Card, I have a laptop HP dv6448se and the video card are a N...
What are Mozilla FireFox 2 add-ons? Mozilla FireFox 2 add-ons extend the browser functionalities. So...
How much does Windows Media Player 11 cost Windows Media Player 11 is a free update to the Windows M...
How to download ActivePerl 5.8.8.820? If you are interested in using Perl on your Windows system, yo...