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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:26:43+00:00 2026-05-14T00:26:43+00:00

I’m doing a bit of Powershell scripting ( for the first time ) to

  • 0

I’m doing a bit of Powershell scripting ( for the first time ) to look at some stuff in a Sharepoint site and what I would like to be able to do is to go through a list of properties of an object and just output their values in a “property-name = value” kind of format.

Now I can find the list of elements using this:

$myObject | get-member -membertype property

Which will return a list of all the properties in a very clear and readable fashion. But what I need is to find a value for those properties.

In some scripting languages I could have a kind of eval( “$myObject.$propertyName” ) call – where I have extracted $propertyName from the get-member output – and have it evaluate the string as code, which for the kind of quick-and-dirty solution I need would be fine.

Does this exist in Powershell or is there a more convenient way to do it? Should I be using reflection instead?

  • 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-14T00:26:43+00:00Added an answer on May 14, 2026 at 12:26 am

    To get the value of properties of an object, you can use several methods.

    First off, you could use Select-Object and use the -Property parameter to specify which property values you would like returned. The how that is displayed will depend on the number of properties you specify and the type of object that it is. If you want all the properties, you can use the wildcard ( * ) to get them all.

    Example –

    $myobject | Select-Object -Property name, length
    $myobject | Select-Object -Property *
    

    You can also control the formatting of the outputs in a similar manner, using Format-List or Format-Table.

    Example –

    $myobject | Format-List -Property *
    $myobject | Format-Table -Property name, length
    

    Finally, to do an “eval” style output you could simply type

    $myobject."$propertyname" 
    

    and the value of the property will be returned.

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

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping 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.