PowerShell Genie

How should a PowerShell function return data for another command to consume?

Question 1 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Write structured objects to the success stream and keep display formatting outside the function.

Interview · Question 14 of 34

Answer before reveal

Your draft

Write the answer you would give in an interview. The model answer stays hidden until you have drafted at least a short response.

Primary documentation

PowerShell objects and pipelines documentation

Continue
Genie guideHow should a PowerShell function return data for another command to consume?

Write structured objects to the success stream and keep display formatting outside the function.