TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Windows Powershell

Notices

Reply
 
Thread Tools Display Modes
Old 26-06-2008, 04:27 PM   #1
chriske911
Guest
 
Posts: n/a
nowrap

how can I get an output from powershell without disappearing
characters?
because I have no idea how wide the displayed information is going to
be I cannot define a width

the command I use is

Get-Mailbox | Where {$_.GrantSendOnBehalfTo -ne $null} | Select Name,
GrantSendOnBehalfTo

I used | ft already and also tried export-csv but every time I get the
same wrapped output

thnx


  Reply With Quote
Old 26-06-2008, 04:27 PM   #2
Leo Tohill
Guest
 
Posts: n/a
RE: nowrap

If it appears truncated in the csv file, I'm thinking that the get-mailbox
command is returning truncated value.

Can you see the full value under any circumstance?


"chriske911" wrote:

> how can I get an output from powershell without disappearing
> characters?
> because I have no idea how wide the displayed information is going to
> be I cannot define a width
>
> the command I use is
>
> Get-Mailbox | Where {$_.GrantSendOnBehalfTo -ne $null} | Select Name,
> GrantSendOnBehalfTo
>
> I used | ft already and also tried export-csv but every time I get the
> same wrapped output
>
> thnx
>
>
>

  Reply With Quote
Old 26-06-2008, 04:28 PM   #3
Marco Shaw [MVP]
Guest
 
Posts: n/a
Re: nowrap

Leo Tohill wrote:
> If it appears truncated in the csv file, I'm thinking that the get-mailbox
> command is returning truncated value.
>
> Can you see the full value under any circumstance?


Maybe try format-long or even format-custom to check this...

I'll fire up my Exchange VM in a few hours otherwise.

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
  Reply With Quote
Old 26-06-2008, 04:28 PM   #4
chriske911
Guest
 
Posts: n/a
Re: nowrap

Leo Tohill presented the following explanation :
> If it appears truncated in the csv file, I'm thinking that the get-mailbox
> command is returning truncated value.


> Can you see the full value under any circumstance?



> "chriske911" wrote:


>> how can I get an output from powershell without disappearing
>> characters?
>> because I have no idea how wide the displayed information is going to
>> be I cannot define a width
>>
>> the command I use is
>>
>> Get-Mailbox | Where {$_.GrantSendOnBehalfTo -ne $null} | Select Name,
>> GrantSendOnBehalfTo
>>
>> I used | ft already and also tried export-csv but every time I get the
>> same wrapped output
>>
>> thnx
>>
>>
>>


indeed, even the output on screen does not give back the full width
necessary to diplay all information
is there a way to force this, be it on the screen or piped to a file?

thnx


  Reply With Quote
Old 26-06-2008, 04:28 PM   #5
Leo Tohill
Guest
 
Posts: n/a
Re: nowrap

do this test:


$x = Get-Mailbox | Where {$_.GrantSendOnBehalfTo -ne $null} | Select Name,
>> GrantSendOnBehalfTo


$x[0].Name.Length

Is the length the truncated length, or the expected length? If it's the
truncated length, then the problem lies in the get-mailbox cmdlet itself.


"chriske911" wrote:

> Leo Tohill presented the following explanation :
> > If it appears truncated in the csv file, I'm thinking that the get-mailbox
> > command is returning truncated value.

>
> > Can you see the full value under any circumstance?

>
>
> > "chriske911" wrote:

>
> >> how can I get an output from powershell without disappearing
> >> characters?
> >> because I have no idea how wide the displayed information is going to
> >> be I cannot define a width
> >>
> >> the command I use is
> >>
> >> Get-Mailbox | Where {$_.GrantSendOnBehalfTo -ne $null} | Select Name,
> >> GrantSendOnBehalfTo
> >>
> >> I used | ft already and also tried export-csv but every time I get the
> >> same wrapped output
> >>
> >> thnx
> >>
> >>
> >>

>
> indeed, even the output on screen does not give back the full width
> necessary to diplay all information
> is there a way to force this, be it on the screen or piped to a file?
>
> thnx
>
>
>

  Reply With Quote
Old 26-06-2008, 04:29 PM   #6
Marco Shaw [MVP]
Guest
 
Posts: n/a
Re: nowrap

Leo Tohill wrote:
> do this test:
>
>
> $x = Get-Mailbox | Where {$_.GrantSendOnBehalfTo -ne $null} | Select Name,
>>> GrantSendOnBehalfTo

>
> $x[0].Name.Length
>
> Is the length the truncated length, or the expected length? If it's the
> truncated length, then the problem lies in the get-mailbox cmdlet itself.


I would think a hard coded limitation in the cmdlet would be a bad idea.

This is likely much more an effect of PowerShell's formatting features.

I checked:
c:\program files\microsoft\exchange server\bin\exchange.format.ps1xml

There is nothing specific to this object/property, so the default
formatting should take effect:

http://blogs.msdn.com/powershell/arc...30/586973.aspx
http://blogs.msdn.com/powershell/arc...ally-work.aspx

This would make a good blog post...

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
  Reply With Quote
Old 26-06-2008, 04:30 PM   #7
Hal Rottenberg
Guest
 
Posts: n/a
Re: nowrap

chriske911 wrote:
> indeed, even the output on screen does not give back the full width
> necessary to diplay all information
> is there a way to force this, be it on the screen or piped to a file?


We know the output on the screen will get truncated, that's by design. The
issue that Leo was raising was that you should NOT see any truncation when you
use Export-CSV. If you do, that means the source data itself is already
truncated, or there is some other mechanism doing that before it gets to export-csv.

So just for argument's sake, can you ensure the source data has all of the
characters you expect?


--
Author, Tech Prosaic blog (http://halr9000.com)
Webmaster, Psi (http://psi-im.org)
Community Director, PowerShellCommunity.org
Co-host, PowerScripting Podcast (http://powerscripting.net)
  Reply With Quote
Old 26-06-2008, 04:31 PM   #8
chriske911
Guest
 
Posts: n/a
Re: nowrap

on 25/06/2008, Hal Rottenberg supposed :
> chriske911 wrote:
>> indeed, even the output on screen does not give back the full width
>> necessary to diplay all information
>> is there a way to force this, be it on the screen or piped to a file?


> We know the output on the screen will get truncated, that's by design. The
> issue that Leo was raising was that you should NOT see any truncation when
> you use Export-CSV. If you do, that means the source data itself is already
> truncated, or there is some other mechanism doing that before it gets to
> export-csv.


> So just for argument's sake, can you ensure the source data has all of the
> characters you expect?


yes and no, if I just use this line of code:
Get-Mailbox | Where {$_.GrantSendOnBehalfTo -ne $null} |export-csv

then I do get full details from the mailbox itself but I cannot get the
info (sendonbehalf) I am looking for

if I try to format the output in any way to get a tabular view it is
always truncated

grtz


  Reply With Quote
Reply

Thread Tools
Display Modes


Google
 


All times are GMT +5.5. The time now is 02:53 AM.


vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2008, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional