Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on format-table... getting format-list output #6

Open
kduerr opened this issue Sep 5, 2016 · 1 comment
Open

Question on format-table... getting format-list output #6

kduerr opened this issue Sep 5, 2016 · 1 comment

Comments

@kduerr
Copy link

kduerr commented Sep 5, 2016

Kirk,

First - Thanks for the module! I have a question, don't know if it is an issue or pilot error.

I have another module I use which imports FormatPX, I had noticed a format issue when I ran my code in a new PS window for the first time (did not have the issue on a second run in the same window). I trimmed my code to this to reproduce it.

My problem: When I do a format-table on the object (test #1), it displays as expected, after I load the FormatPX and do the same format-table (test #2), I get a format-list output instead of format-table.

==code-sample==================
$menuObj = @(
[pscustomobject]@{choice="1";labelx="x";function="Function #1";desc="Description...1"; status="x"},
[pscustomobject]@{choice="2";labelx="x";function="Function #2";desc="Description...2"; status="x"}
)

write-host "nn Test #1 "
$menuObj |Format-Table

Import-Module FormatPX
(Get-Module FormatPX).Version

write-host "nn Test #2 "

$menuObj |Format-Table

Execution of script output:
PS C:\Users\Administrator\OneView-shell> .\test.ps1

Test #1

choice labelx function desc status


1 x Function #1 Description...1 x
2 x Function #2 Description...2 x

Major Minor Build Revision


1 1 3 15

Test #2

choice : 1
labelx : x
function : Function #1
desc : Description...1
status : x

choice : 2
labelx : x
function : Function #2
desc : Description...2
status : x

PS C:\Users\Administrator\OneView-shell>

Additional info
PS C:\Users\Administrator\OneView-shell> $PSVersionTable

Name Value


PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.17929
BuildVersion 6.3.9600.16406
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2

Thanks
-Kelly

@Verayth
Copy link

Verayth commented Sep 23, 2018

I've noticed this same problem when using FormatPx in PS scripts run from Jenkins. The only solution I've found was to import the module in my $PROFILE. Without this work-around, ALL output acts like I've just done a "Select-Object *".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants