troubleshooting Question

How to Select Set of Properties and Expand Another Property in Powershell

Avatar of Terry Rogers
Terry RogersFlag for United Kingdom of Great Britain and Northern Ireland asked on
Powershell
1 Comment1 Solution6 ViewsLast Modified:
I am running the following PowerShell command:

Get-WSManInstance -ResourceURI winrm/config/Listener -Enumerate -ComputerName LOCALHOST | Format-List -Property Transport,Address,Port,Hostname,Enabled,@{ Name = 'ListeningOn'; Expression = { $_ | Select-Object -ExpandProperty ListeningOn }}

Open in new window

I get the following output:
Transport   : HTTP
Address     : *
Port        : 5985
Hostname    : 
Enabled     : true
ListeningOn : {127.0.0.1, 169.254.2.215, 192.168.26.190, 192.168.26.191...}

Transport   : HTTPS
Address     : *
Port        : 5986
Hostname    : LOCALHOST
Enabled     : true
ListeningOn : {127.0.0.1, 169.254.2.215, 192.168.26.190, 192.168.26.191...}

Open in new window

I would like to expand the ListeningOn Property to it displays all values like the first four in a comma list on a single line.

How can I achieve this?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros