Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

PowerTip: Easily Find the Value of a PowerShell Variable

$
0
0

Summary: Learn how to return only the value of a Windows PowerShell variable.

Hey, Scripting Guy! Question How can I use a Windows PowerShell cmdlet to return only the value of a particular variable?

Hey, Scripting Guy! Answer Use the Get-Variable cmdlet, and specify the name of the variable and the –valueonly switch. This technique is shown here using the home variable:

PS C:\> Get-Variable -Name home -ValueOnly

C:\Users\ed.IAMMRED


Viewing all articles
Browse latest Browse all 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>