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, ∼2714🔥, 0💬
Popular Posts:
This is what I do Charms bar >Settings> Change my PC settings > User > "Trust this PC" When I get my...
Whenever I try to open the mail app I get a white screen with a grey banner that says Mail Can't Ope...
Can I remove startup application "YahooMessenger.exe - Yahoo Instant Messenger" to speedup my comput...
Why I am getting the "Warning: Unresponsive Script" message box? How to avoid this message box? When...
I'm trying to upload pictures from my Samsung camera and Windows 8 keep saying "Something went wrong...