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, ∼3191🔥, 0💬
Popular Posts:
How programs are added to the startup application list? There are 3 main ways in which programs are ...
Where to find tutorials on Internet Explorer (IE)? Here is a large collection of tutorials to answer...
What is "Windows Backup" in my Windows XP service list? And how is "Windows Backup" service related ...
How to uninstall OpenOffice.org 2.2? If you want to uninstall OpenOffice.org 2.2, you should follow ...
How to use sc.exe command to create a new service? If you want to create a new service, you can use ...