Collections:
Other Resources:
Expression Expansion in Strings in Windows PowerShell
What is expression expansion in strings in Windows PowerShell?
✍: FYIcenter.com
Expression expansion in strings is a short-hand of string concatenation operations
using the following syntax rule:
When an expression enclosed in parentheses following a $ sign is included in a double-quoted string literal like "... $(expression) ...", it will be replaced with the string representation of the express result.
In other words, the following two expressions are identical:
"Leading text $($a*$b) trailing text." "Leading text "+($a*$b)+" trailing text."
Here are some good examples of using expression expansion in a string:
PS C:\fyicenter> Write-Host "Current time is $( (Get-Date).TimeOfDay )." Current time is 19:16:33.4997682. PS C:\fyicenter> "Firefox virtual memory size = $( (Get-Process Firefox).VirtualMemorySize)." Firefox virtual memory size = 1175629824.
⇒ String Comparison in Windows PowerShell
⇐ Variable Expansion in Strings in Windows PowerShell
2016-10-19, ∼2492🔥, 0💬
Popular Posts:
What is "Lenovo Camera Mute" in a service on Lenovo laptop computer that supports the camera on/off ...
Where to find tutorials on managing Windows 7 scheduled tasks? Here is a collection of tutorials on ...
How do I know which version of Internet Explorer (IE) is on my computer? If you want to know which v...
How to connect your computer to a DSL line? Here are the steps of how to connect your computer to th...
Can I disable Windows service "EvtEng" to speedup my computer? Windows service "EvtEng" - Intel Even...