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, ∼3344🔥, 0💬
Popular Posts:
What is "Net Driver HPZ12" in my Windows 7 service list? And how is "Net Driver HPZ12" service relat...
How to verify if your system is connected to the Internet? Windows system has two commands "ipconfig...
How to download and install Alexa Toolbar for Internet Explorer (IE) 7 browser? Alexa Toolbar offers...
What is AccelerometerSt.exe process - Hp Accelerometer System Tray? Process AccelerometerSt.exe is t...
How to remove DSAgnt.exe from the startup application list to gain performance and reduce security r...