Write-Host is brain dead. If you use write-object in your code block it returns what you'd expect. If you do write-host $myvar.autoreplystate it also returns what you'd expect.
Seriously though, don't use write-host. It kills kittens. DAMIEN SOLODOW Systems Engineer 317.447.6033 (office) 317.447.6014 (fax) HARRISON COLLEGE ________________________________ From: [email protected] [[email protected]] on behalf of Daniel Chenault [[email protected]] Sent: Monday, February 02, 2015 7:11 PM To: [email protected] Subject: [powershell] @{?? Exchange-specific cmdlet but the actual question is more generic $myvar = get-mailboxautoreplyconfiguration -identity <alias> | select-object autoreplystate write-host $myvar outputs: @{Autoreplystate=disabled} Why does $myvar get populated with that instead of just "Disabled"? I've been searching and maybe I"m just using the wrong search terms but I'm getting bupkes as an explanation for this or how to get only the value. ================================================ Did you know you can also post and find answers on PowerShell in the forums? http://www.myitforum.com/forums/default.asp?catApp=1 ================================================ Did you know you can also post and find answers on PowerShell in the forums? http://www.myitforum.com/forums/default.asp?catApp=1
