![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | variable display? is there a way to list out all variables? i tend to leave my console up for days at a time and toss things in here and there... can i get a list of what variables i have out there? can it show the values? also is there a time out period for those or do they last forever? if they last, there is obviously a bit of a resource issue that could arise huh? Thanks Justin |
My System Specs![]() |
| | #2 (permalink) |
| | Re: variable display? PowerShell keeps the variables in the Variable: PSProvider. You can view them like: ls variable: Variables are live throughout the session unless you remove or clear them. -- Kiron |
My System Specs![]() |
| | #3 (permalink) |
| | Re: variable display? Justin Rich wrote: Quote: > is there a way to list out all variables? > > i tend to leave my console up for days at a time and toss things in here and > there... can i get a list of what variables i have out there? can it show > the values? > > > also is there a time out period for those or do they last forever? if they > last, there is obviously a bit of a resource issue that could arise huh? > > Thanks > Justin > > http://groups.google.com/group/micro...53ca7e027eaa9f Where Jeffrey Snover posts about "start-newscope" Also, you can just create all variables beginning with $myvar, for example, then you can easily do something like 'remove-variable myvar*' to clear out all the variables you created. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #4 (permalink) |
| | Re: variable display? Hi Justin, I just want to add a few more things to what's already been said. I have posted a powerful one-liner that can be used to retrieve all variables, their values, descriptions, types, etc. here: http://poshoholic.com/2007/09/18/ess...tem-variables/ If you don't follow a standard naming scheme as Marco has recommended, you could always open a new PowerShell window and retrieve the variables in that session, retrieve the variables in your old session, and compare the two to see what has changed. And one last hint: most (but not all!) of the system variables have descriptions. I suspect your variables don't have descriptions (most people don't create variables with descriptions). You could write a script to retrieve all variables without descriptions whose name is not in the list of system variables that don't have descriptions (and you could retrieve that list from a new PowerShell session). -- Kirk Munro Poshoholic http://poshoholic.com "Justin Rich" <jrich523@xxxxxx> wrote in message news:uSngMxGLIHA.4584@xxxxxx Quote: > is there a way to list out all variables? > > i tend to leave my console up for days at a time and toss things in here > and there... can i get a list of what variables i have out there? can it > show the values? > > > also is there a time out period for those or do they last forever? if they > last, there is obviously a bit of a resource issue that could arise huh? > > Thanks > Justin > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| display variable | PowerShell | |||
| Re: How to display a variable value in a dialog box and how to readuser input? | VB Script | |||
| Re: How to display a variable value in a dialog box and how to read user input? | VB Script | |||
| Display variable in balloon notification | PowerShell | |||
| How can I ensure that a variable is a built-in powershell variable? | PowerShell | |||