I need to write a custom powershell cmdlet in C# that would accept data and be able to enumerate over it. I have followed some examples online and have some working code.
The problem I have can be demonstrated as follows:
The problem I have is that I am not sure how to setup a parameter to take a table of data in Not sure how to output data from my cmdlet in table form.
Can anyone provide any examples?
I have no idea what you mean with "table format". In PowerShell you should work with objects (or, of course, lists of objects).
What you want to do, to create a cmdlet which takes the output of one command as it's input, i.e. accepts pipeline input, is to mark one of your parameter to take the value from the pipeline. You can find good instructions on how to do this at the MSDN section on Adding Parameters that Process Pipeline Input.