Categories:
Administration (10)
Adware Spyware (7)
Apache (10)
Bluetooth (125)
DOS Commands (1)
Edge (28)
General (2)
Internet Explorer (217)
Media Center (12)
Media Player (11)
Mozilla Firefox (18)
PHP (15)
Programming (8)
Security (4)
Silverlight (15)
Tips (17)
Tools (218)
Tutorials (5)
Windows 10 (166)
Windows 7 (636)
Windows 8 (1091)
Windows Phone (33)
Windows Server 2008 (165)
Windows Server 2012 (84)
Windows Server 2016 (23)
Windows Vista (52)
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
⇑ Work with Strings in Windows PowerShell
⇑⇑ Windows PowerShell Tutorials
2016-10-19, 1429👍, 0💬
Popular Posts:
How programs are added to the startup application list? There are 3 main ways in which programs are ...
How to add a network user on a Windows 10 Pro computer? The network user already exists on the compa...
A collection of 8 tutorials on Internet connections with DSL modems covering: What are required to u...
Can I disable Windows service "McAfee Framework Service" to speedup my computer? Third party service...
Can I remove startup application "issch.exe - InstallShield Update Service Scheduler" to speedup my ...