Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

List all variables in a script

$
0
0

Hi All,

Do we have a command or script which lists/displays variables used in a script? Ex, i have a posh script, which has 10 variables . I need list of only those 10 variables. I dont need default variables. When this question came to my mind, I got only one answer. First using get-variable, export all the default variables to a text file. Then run your script. Now again execute get-variable and export it to another text file. Now compare two files. can we achieve this with more better solution? Is it possible? 

 

Chaitanya.


Viewing all articles
Browse latest Browse all 6937

Trending Articles