Reputation: 31610
Sometimes when I'm writing a script I want to dump the value of a bunch of variables in my script to the console along with the variable's name.
Instead of having to do "var1: $var1" for all of my variables is there a powershellism that can display a bunch of variables along with their names? Is there some kind of convenient reflectiony thing for this?
Upvotes: 2
Views: 119
Reputation: 22132
You can use Get-Variable
cmdlet, which return PSVariable
objects to you. By default, them formatted as table with two columns: Name
and Value
.
Upvotes: 3