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, ∼2874🔥, 0💬
Popular Posts:
How to remove BacsTray.exe from the startup application list to gain performance and reduce security...
Where does Mozilla FireFox 2 store cookie files on my computer? Some cookies are stored to your comp...
Can I disable Windows service "Remote Procedure Call (RPC)" to speedup my computer? Windows service ...
I have a program called (Default) with no description as to what it is for. Listed in the administra...
What is the startup program "fsquirt - fsquirt.exe" on my Windows 8 computer? Can I remove it to spe...