-2

$b = "a00000"

Now due to a complicated application, i want to access $a00000.ID The application stores a return object inside a variablename (which is a string value of another)

When i try "$b" it shows the value, but $"$b".ID is an error ${$b}.ID is also an error $'"$b"'.ID is also an error

How do i access value of $a00000.ID given that previously $b=a00000 ? (one variable name is assigned by a previous string value)

1

1 Answer 1

1

Give this a try:

(Get-Variable $b -ValueOnly).Id
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.