Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9138913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:19:07+00:00 2026-06-17T09:19:07+00:00

How can I use the output from a custom module to put into a

  • 0

How can I use the output from a custom module to put into a variable preferably an object.

Here is the problem. After importing the custom module and running the cmdlet it always outputs the same info and refuses to be stored in a variable or put into the pipeline. Trying to put in the pipeline or a variable just reproduces the original output and ignores the variable or pipeline symbol.

Example:

PS C:\> Get-FCoEPorts -HbaIndex 0
Port List

Index   NodeWWN                         PortWWN                         FCID

-----   -------                         -------                         ----

 0      10:00:A0:36:9F:0B:3E:E9         20:00:A0:36:9F:0B:3E:E9                     0x4A0680

 1      20:A8:00:0D:EC:96:EA:01         00:FC:0E:00:A8:00:80:00                 0x36A00120

 ...

 93*    10:00:A0:36:9F:0B:3E:E9         20:3E:A0:36:9F:0B:3E:E9                 0x4A0764

 94     20:A8:00:0D:EC:96:EA:01         00:FC:0E:00:A8:00:80:00                 0x36A03F20

* - Virtual Ports.

So that is the expected output but trying this:

$a = Get-FCoEPorts -HbaIndex 0

or this:

(Get-FCoEPorts -HbaIndex 0).PortWWN

or this:

$getports = Get-FCoEPorts -HbaIndex 0 | select -expand PortWWN

Each command gives the same results as shown at top and trying to use the variables that are referenced results in no output… It’s like PowerShell is ignoring all the other commands except Get-IntelFCoEPorts.
Is this a problem with the code I’m using or is it likely a problem with the code behind the module?

My goal in working with this module is to get the PortWWN Numbers into an array or object that I can reference and use to loop through when I need to remove them.

I asked the developer for an updated version of his module, but the new version produced the same results. I want to make sure my code is correct before I badger him anymore.

UPDATE:
I tried outputting to a file with no luck. The file is empty. I also tried starting and stopping a transcript like so:

C:\> $ErrorActionPreference="SilentlyContinue"
PS C:\> Stop-Transcript | out-null
PS C:\> $ErrorActionPreference = "Continue"
PS C:\> Start-Transcript -path C:\Users\Administrator\Desktop\output.txt -append
Transcript started, output file is C:\Users\Administrator\Desktop\output.txt
PS C:\> Get-IntelFCoEPorts -HbaIndex 0
    Index   NodeWWN                         PortWWN                         FCID

-----   -------                         -------                         ----

 0      10:00:A0:36:9F:0B:3E:E9         20:00:A0:36:9F:0B:3E:E9                     0x4A0680

 1      20:A8:00:0D:EC:96:EA:01         00:FC:0E:00:A8:00:80:00                 0x36A00120

 ...

 93*    10:00:A0:36:9F:0B:3E:E9         20:3E:A0:36:9F:0B:3E:E9                 0x4A0764

 94     20:A8:00:0D:EC:96:EA:01         00:FC:0E:00:A8:00:80:00                 0x36A03F20

* - Virtual Ports.
PS C:\> Stop-Transcript
Transcript stopped, output file is C:\Users\Administrator\Desktop\output.txt

The output was as so:

PS C:\> Stop-Transcript
Transcript started, output file is C:\Users\Administrator\Desktop\output.txt
PS C:\> Get-IntelFCoEPorts -HbaIndex 0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:19:08+00:00Added an answer on June 17, 2026 at 9:19 am

    It looks like the developer is probably formatting their own output. Either that or they are using Write-Host. I suspect the former but in either case the prescribed way to do what they want is to output objects without running them through Format-* or Write-Host. If they want to have a nice default formatted display, then they need to create a format file .ps1xml and use Update-FormatData or use the module’s FormatsToProcess field in the .psd1 file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I get output from Java anonymous classes? In .Net I would use
In Oracle, we can use FOR employee_rec in (select id from mytbl) LOOP DBMS_OUTPUT.PUT_LINE(employee_rec.id);
How can I use output caching with a .ashx handler? In this case I'm
Just curious, is there a format string I can use to output something like
I've noticed that you can use python libdiff to output a side by side
UPDATE: I know I can use <ol> directky in the output but I remember
Can I use Html Agility Pack to make the output look nicely indented, unnecessary
I can use this maven plugin maven-jaxb-plugin to generate Java Classes from XSD file.
We use a custom doclet to generate a report from custom javadoc tags, and
I build a custom AuthenticationSuccessHandler so users can login using Ajax aswell use a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.