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, ∼3394🔥, 0💬
Popular Posts:
How to start sc.exe command to create, delete and manage Windows services? sc.exe is a command line ...
What is the best way to remove programs from the startup application list? There are a number of way...
What files are used by Alexa Toolbar for Internet Explorer (IE) 7 browser? How Alexa Toolbar is conf...
Where to find tutorials on using Windows 7 Security? Here is a collection of tutorials on Windows 7 ...
What is "Health Key and Certificate Management" in my Windows XP service list? And how is "Health Ke...