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:
Variable Expansion in Strings in Windows PowerShell
What is variable expansion in strings in Windows PowerShell?
✍: FYIcenter.com
Variable expansion in strings is a short-hand of string concatenation operations
using the following syntax rule:
When a variable is included in a double-quoted string literal like "... $variable ...", it will be replaced with the string representation of the variable value.
In other words, the following two expressions are identical:
"Leading text $var trailing text." "Leading text "+$var+" trailing text."
Remember, if you want to keep $var as 3 characters instead of a variable, you need to use the $ sign escape sequence. Here is a good example of using variable expansion in a string:
PS C:\fyicenter> $name = "John" PS C:\fyicenter> Write-Host "Value of `$name: $name" Value of $name: John
Â
⇒ Expression Expansion in Strings in Windows PowerShell
⇠String Concatenation in Windows PowerShell
⇑ Work with Strings in Windows PowerShell
⇑⇑ Windows PowerShell Tutorials
2016-10-20, 1771👍, 0💬
Popular Posts:
How to use .htaccess file with Apache server on Window systems? Assuming that you have installed the...
What is the "IP Helper (iphlpsvc)" system service on Windows Server 2012? Can I disable "IP Helper"?...
What is "UPnP Device Host" in my Windows 7 service list? And how is "UPnP Device Host" service relat...
What is "SSDP Discovery" in my Windows 7 service list? And how is "SSDP Discovery" service related t...
What is the startup program "CyberLink MediaLibray Service - CLMLSvc_P2G8.exe" on my Windows 8 compu...