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, 1971🔥, 0💬
Popular Posts:
Can I remove startup application "realsched.exe - Real Player RealNetworks Scheduler" to speedup my ...
How to use sc.exe command to start and stop an existing service? If you want to start or stop a serv...
What is the scheduled task "\Microsoft\Windows\Wini net\CacheTask"on my Windows 7 computer? "\Micros...
Can I remove startup application "YahooMessenger.exe - Yahoo Instant Messenger" to speedup my comput...
What to Do When HelpSvc.exe Is Running Out of Control - Using High CPU and Memory? If you find your ...