Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Newbie output question

Closed Thread
 
Thread Tools Display Modes
Old 04-11-2007   #1 (permalink)
Damon
Guest


 

Newbie output question

Hey all,
I just started with powershell last night and I am loving it so far.
I wrote this.
$ser = Get-Content c:\wmitest\servers.txt
Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
Format-Table
It works as far as getting the data I am looking for.
I am wanting to output the server name (taken from the txt file) and the data.
I can format what it gives me several ways but can not get the server name
(off the servers.txt file) to display
Thanks
Old 04-11-2007   #2 (permalink)
June Blender (MSFT)
Guest


 

RE: Newbie output question

Is there any reason to use the server name from your text file, instead of
the server name on the WMI object?

Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
Format-Table __Server, DebugFilePath, Name -auto

And, welcome to Windows PowerShell!
--
June Blender [MSFT]
Windows PowerShell Documentation
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.



"Damon" wrote:

> Hey all,
> I just started with powershell last night and I am loving it so far.
> I wrote this.
> $ser = Get-Content c:\wmitest\servers.txt
> Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> Format-Table
> It works as far as getting the data I am looking for.
> I am wanting to output the server name (taken from the txt file) and the data.
> I can format what it gives me several ways but can not get the server name
> (off the servers.txt file) to display
> Thanks

Old 04-11-2007   #3 (permalink)
Damon
Guest


 

RE: Newbie output question

Hey June thanks for the fast responce.
The server name on the WMI object should be OK.
I typed
Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> Format-Table __Server, DebugFilePath, Name -auto

and it gives me a table with _server in the header but no data under it.
The rest still works well, but I do not have the server name show up.
My goal is to have a table with the server name and then name -auto.
Thanks again for the help.

"June Blender (MSFT)" wrote:

> Is there any reason to use the server name from your text file, instead of
> the server name on the WMI object?
>
> Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> Format-Table __Server, DebugFilePath, Name -auto
>
> And, welcome to Windows PowerShell!
> --
> June Blender [MSFT]
> Windows PowerShell Documentation
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
> "Damon" wrote:
>
> > Hey all,
> > I just started with powershell last night and I am loving it so far.
> > I wrote this.
> > $ser = Get-Content c:\wmitest\servers.txt
> > Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> > Format-Table
> > It works as far as getting the data I am looking for.
> > I am wanting to output the server name (taken from the txt file) and the data.
> > I can format what it gives me several ways but can not get the server name
> > (off the servers.txt file) to display
> > Thanks

Old 04-12-2007   #4 (permalink)
Damon
Guest


 

RE: Newbie output question

Thanks again June,
That did work, I was not putting two underscores in front of the server.
Thanks


"Damon" wrote:

> Hey June thanks for the fast responce.
> The server name on the WMI object should be OK.
> I typed
> Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> > Format-Table __Server, DebugFilePath, Name -auto

> and it gives me a table with _server in the header but no data under it.
> The rest still works well, but I do not have the server name show up.
> My goal is to have a table with the server name and then name -auto.
> Thanks again for the help.
>
> "June Blender (MSFT)" wrote:
>
> > Is there any reason to use the server name from your text file, instead of
> > the server name on the WMI object?
> >
> > Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> > Format-Table __Server, DebugFilePath, Name -auto
> >
> > And, welcome to Windows PowerShell!
> > --
> > June Blender [MSFT]
> > Windows PowerShell Documentation
> > Microsoft Corporation
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> >
> > "Damon" wrote:
> >
> > > Hey all,
> > > I just started with powershell last night and I am loving it so far.
> > > I wrote this.
> > > $ser = Get-Content c:\wmitest\servers.txt
> > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> > > Format-Table
> > > It works as far as getting the data I am looking for.
> > > I am wanting to output the server name (taken from the txt file) and the data.
> > > I can format what it gives me several ways but can not get the server name
> > > (off the servers.txt file) to display
> > > Thanks

Old 04-13-2007   #5 (permalink)
June Blender (MSFT)
Guest


 

RE: Newbie output question

Glad it worked for you.

One great habit to develop is to send every object that you get to
Get-Member, and then examine all of its properties and methods.

Then, get an instance of the object and view the values of all of its
properties.

You can also look up the object on MSDN and read about the properties and
methods.

You can search the help, too:
function search-help { select-string -path $pshome\*.txt,
$pshome\*dll-help.xml -pattern $args[0] }
E.g. search-help regex

That will get you 80% of what you need.

For the remaining 20%, ask the experts.
--
June Blender [MSFT]
Windows PowerShell Documentation
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.



"Damon" wrote:

> Thanks again June,
> That did work, I was not putting two underscores in front of the server.
> Thanks
>
>
> "Damon" wrote:
>
> > Hey June thanks for the fast responce.
> > The server name on the WMI object should be OK.
> > I typed
> > Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> > > Format-Table __Server, DebugFilePath, Name -auto

> > and it gives me a table with _server in the header but no data under it.
> > The rest still works well, but I do not have the server name show up.
> > My goal is to have a table with the server name and then name -auto.
> > Thanks again for the help.
> >
> > "June Blender (MSFT)" wrote:
> >
> > > Is there any reason to use the server name from your text file, instead of
> > > the server name on the WMI object?
> > >
> > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> > > Format-Table __Server, DebugFilePath, Name -auto
> > >
> > > And, welcome to Windows PowerShell!
> > > --
> > > June Blender [MSFT]
> > > Windows PowerShell Documentation
> > > Microsoft Corporation
> > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > >
> > >
> > >
> > > "Damon" wrote:
> > >
> > > > Hey all,
> > > > I just started with powershell last night and I am loving it so far.
> > > > I wrote this.
> > > > $ser = Get-Content c:\wmitest\servers.txt
> > > > Get-WmiObject win32_osrecoveryconfiguration -computername $ser |
> > > > Format-Table
> > > > It works as far as getting the data I am looking for.
> > > > I am wanting to output the server name (taken from the txt file) and the data.
> > > > I can format what it gives me several ways but can not get the server name
> > > > (off the servers.txt file) to display
> > > > Thanks

Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie question Steve Grosz PowerShell 6 05-29-2008 07:34 PM
Newbie question Bare Foot Kid Graphic cards 2 04-12-2008 05:38 PM
Newbie - Output to a text file problem. Kryten PowerShell 9 10-11-2007 04:46 PM
Newbie question JasonJFT PowerShell 6 09-09-2007 04:40 PM
RE: Newbie Question cccstar PowerShell 0 12-18-2006 02:31 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50