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 6354115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:31:34+00:00 2026-05-24T22:31:34+00:00

function Get-NaLUNbyMap { <# .DESCRIPTION Gets Lun Information for a particular initiatorgroup name &

  • 0
function Get-NaLUNbyMap {
<#
.DESCRIPTION
Gets Lun Information for a particular initiatorgroup name & lunid
.EXAMPLE
Get-Inventory -computername server-r2
.EXAMPLE
Import-Module NaLUNbyMap
Get-NaLUNbyMap -igroup "IA" -lunid 1
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
[string[]]$igroup,
[Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
[string[]]$lunid
)
Process 
{ 

$info = (Get-NaLun |Select @{Name="LUN";Expression={$_.path}},@{Name="Size";Expression={[math]::Round([decimal]$_.size/1gb,0)}},@{Name="OnlineStatus";Expression={$_.online}},@{Name="Group";Expression={([string]::Join(",",(Get-NaLun $_.path | get-nalunmap | select -ExpandProperty initiatorgroupname)))}},@{Name="LunID";Expression={Get-NaLun $_.path | get-nalunmap | select -ExpandProperty lunid}} | ?{$_.group -eq $igroup -and $_.lunid -eq $lunid})
return $info
}
}

Hi Im unable to return output from this function, can some one please help me out!

  • 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-05-24T22:31:34+00:00Added an answer on May 24, 2026 at 10:31 pm

    That is some ugly code. 🙁

    Here is a cleaned up version. I think I found your problem. Your parameters are arrays, when they should be single values based on how you are using them.

    function Get-NaLUNbyMap {
        <#
        .DESCRIPTION
        Gets Lun Information for a particular initiatorgroup name & lunid
        .EXAMPLE
        Get-Inventory -computername server-r2
        .EXAMPLE
        Import-Module NaLUNbyMap
        Get-NaLUNbyMap -igroup "IA" -lunid 1
        #>
        [CmdletBinding()]
        param(
            [Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)]
            [string]$igroup
            ,
            [Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)]
            [string]$lunid
        )
    
        process { 
            $Luns = foreach ($Lun in Get-NaLun) {
                $LunMap = Get-NaLunMap $_.Path
    
                New-Object PSObject -Property @{
                    "LUN"= $_.Path
                    "Size" = [Math]::Round([Decimal]$_.Size / 1gb, 0)
                    "OnlineStatus" = $_.Online
                    "Group" = $LunMap | Select-Object -ExpandProperty InitiatorGroupName
                    "LunId" = $LunMap | Select-Object -ExpandProperty LunId
                }
            }
            $Luns | Where-Object {$_.Group -eq $igroup -and $_.LunId -eq $lunid}
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this example: Interface CustomersDao Function Get(ByVal Id As Integer) As Customer Function Get(ByVal
How do i get rid of this error? code: function get_green_entities($c,$array){ $thisC = &$this->output[$this->sessID];
$('#submit').click(function () { //Get the data from all the fields var name = $('input[name=name]');
I have code for get part of anchor: function _get_part(queryString, name) { var match
function get_arr($arr) { unset($arr[0]); } $arr1 = array(1,2); $arr2 = array(1,2); get_arr(&$arr1); get_arr($arr2); echo
Given this function: > function Get-ArrayOfArrays() { (1,2),(3,4) | % { $_ } }
function get_ibo_id() { if($registerquery = $this->conn->query(SELECT ibo_id FROM fasttrack WHERE count < 8 &&
My function get QueryString from some Web page as a string . I need
function publish(text) { $('#helpdiv').prepend(text); } function get_help(topic) { $.get(topic, publish); } <p>Hi. <a href=#
$(#listView object.modal).click(function(){ // Get the ID of the clicked link: var link = $(this).closest(h2).attr(title);

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.