79639628

Date: 2025-05-26 22:25:40
Score: 2.5
Natty:
Report link

https://powershellfaqs.com/convert-object-to-array-in-powershell/ has a simpler method.

Use $array = @($object).

I needed to pass the resulting array onto a function, so I changed:

-contents $object

to

-contents @($object)

Reasons:
  • Blacklisted phrase (0.5): I need
  • Low length (1):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Roy Latham