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, ∼2570🔥, 0💬
Popular Posts:
How to set up Internet Explorer 8, or IE 8? After downloading Internet Explorer 8. or IE 8, you shou...
Can I remove startup application "WZQKPICK.exe - WinZip Quick Pick" to speedup my computer and reduc...
Where does Mozilla FireFox 2 store cookie files on my computer? Some cookies are stored to your comp...
Every time I open Internet Explorer a bar pops up saying that it is runner with out add ons. I check...
What is a slide master? A slide master is a set of slide layouts defined to help you create differen...