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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:01:08+00:00 2026-06-14T10:01:08+00:00

I have a complex script that evaluates attributes from a web service. I build

  • 0

I have a complex script that evaluates “attributes” from a web service.
I build a list of all attributes and information about them in a list called $global:attributes and determine if they are single/multivalue value and are references.

Below is a snippet:

#Build the object
$obj = new-object object
$obj | Add-Member -MemberType NoteProperty -Name AttributeName -Value "Applications"
$obj | Add-Member -MemberType NoteProperty -Name IsReference -Value $true
$obj | Add-Member -MemberType NoteProperty -Name IsMultiValued -Value $true
$global:attributes = $obj

Now the following commands return “true” right?

(($global:attributes | where { $_.AttributeName -eq "Applications" }).IsReference -eq $true)
(($global:attributes | where { $_.AttributeName -eq "Applications" }).IsMultiValued -eq $true)

So why does the given function below doesn’t evaluate as expected? Is it because I am invoking the where clause in a nested if statement?

Function doTest($key)
{
    if (($global:attributes | where { $_.AttributeName -eq $key}).IsReference -eq $true)
    {
        write-host "$key is of type Reference"
        if (($global:attributes | where { $_.AttributeName -eq $key}).IsMulitValued -eq $true)
        {
            write-host "$key is multivalued"
        }
        else {
            write-host "$key is single value"
        }
    } else {
        if (($global:attributes | where { $_.AttributeName -eq $key}).IsMultiValued -eq $true)
        {
            write-host "$key is Multivalue other"
        } else {
            write-host "$key is single value other"
        }
    }
}

This command
doTest -key "Applications" returns

Applications is of type Reference
Applications is single value

Should be multivalued, right?

  • 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-14T10:01:09+00:00Added an answer on June 14, 2026 at 10:01 am

    You have a typo in your code above… “IsMulitValued” instead of “IsMultiValued”. When I changed that and ran it locally it produced your expected output.

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

Sidebar

Related Questions

I have a complex script that takes variables from files and uses them to
If I have a script that handles state information that's a bit more complex
I have a complex Powershell script that gets run as part of a SQL
I have a PHP script that creates large complex tables. I am attempting to
I have a script that works great. It is quite complex and does numerous
I currently have a PowerShell script that is used for complex automated Exchange mailbox
I have recently written some complex ruby script that eventually fails with segfaults in
I have complex code blocks, in a Matlab script, that act on large, non-sparse
I have a quite complex form that presents an option to run a script
I would like to have a complex form that uses various VBA script files.

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.