![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | RE: variable identification This sounds like it might be a job for new-hashobject. It's part of the PowerShell Community Extensions 1.1. It converts a hash table to a custom PS object, with the key names as properties, and the associated key value as the property value. Then you can aggregate them as collections and do things like export-csv for output. "Neil Chambers" wrote: > Hello Powershell Gurus, > > I'm looping through a large number of hashtables and sending data to excel. > In order to have the data nicely formatted I am currently laying out the > row/column headers to pre-defined locations. What I'd like to do is pull > header information directly from the datastore. > > The only (dooable) thing that comes to mind right now is to load information > about the hashtable in the first keypair. This is certainly achievable but > I'm hoping there is something else, something marvelous, that might help. Is > it possible to 'name' a powershell hashtable object other than the assigned > object name? For that matter, is it possible to find the variable name eg. > > *wish 1 > $mytable.hiddenProperty.VarName = "Cheese Stock" > $mytable.hiddenProperty.VarDescription = "a table of cheese stock items" > > *wish 2 > foreach ($table in $table1,$table2,$object1,$variable4){ > 'show me the inherited variable name of $table > or > 'show me the super-secret hidden 'variable name' property which I set > earler > } > > As I'm writing this out another option comes to mind: I could group my > tables into another table and set the values as descriptions. Not as nice as > the (surely they exist) hidden properties. > > Ideas, anyone? > > Cheers > neil > |
My System Specs![]() |
| | #2 (permalink) |
| | Re: variable identification Oooh. lovely extensions. I'll certinaly give that a go. Thanks Rob! "Rob Campbell" <RobCampbell@discussions.microsoft.com> wrote in message news:95E4BA8A-4C5B-4C63-9F80-41BDF9A71C1B@microsoft.com... > This sounds like it might be a job for new-hashobject. > > It's part of the PowerShell Community Extensions 1.1. > > It converts a hash table to a custom PS object, with the key names as > properties, and the associated key value as the property value. Then you > can > aggregate them as collections and do things like export-csv for output. > > "Neil Chambers" wrote: > >> Hello Powershell Gurus, >> >> I'm looping through a large number of hashtables and sending data to >> excel. >> In order to have the data nicely formatted I am currently laying out the >> row/column headers to pre-defined locations. What I'd like to do is pull >> header information directly from the datastore. >> >> The only (dooable) thing that comes to mind right now is to load >> information >> about the hashtable in the first keypair. This is certainly achievable >> but >> I'm hoping there is something else, something marvelous, that might help. >> Is >> it possible to 'name' a powershell hashtable object other than the >> assigned >> object name? For that matter, is it possible to find the variable name >> eg. >> >> *wish 1 >> $mytable.hiddenProperty.VarName = "Cheese Stock" >> $mytable.hiddenProperty.VarDescription = "a table of cheese stock items" >> >> *wish 2 >> foreach ($table in $table1,$table2,$object1,$variable4){ >> 'show me the inherited variable name of $table >> or >> 'show me the super-secret hidden 'variable name' property which I set >> earler >> } >> >> As I'm writing this out another option comes to mind: I could group my >> tables into another table and set the values as descriptions. Not as nice >> as >> the (surely they exist) hidden properties. >> >> Ideas, anyone? >> >> Cheers >> neil >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: WMP 11 DVD identification | Vista music pictures video | |||
| WMP 11 DVD identification | Vista music pictures video | |||
| another question about variable identification | PowerShell | |||
| Re: variable identification | PowerShell | |||
| How can I ensure that a variable is a built-in powershell variable? | PowerShell | |||