i encountered a problem when trying to build a small read-host script that pipes the result into an AD script:
when doing an AD search, i can select objects like that:
get-aduser exampleuser | select-object name,enabled
though when i enter
name,enabled
into the read-host that stores the input as a variable which later gets used in the script, it turns into this:
name,enabled
------------
{}
instead of this (when typing it manually)
get-adcomputer CTXTEST | select-object name,enabled
name enabled
---- -------
CTXTEST False
I assume that I overlook something rather simple, but I tried a lot of things and didnt find a solution through master Google.