I am trying to remove PSComputerName and RunspaceId from my output. I have tried -ExcludeProperty in different locations with no luck. I am guessing it is in my new PSObject?
I find that -ExcludeProperty works against the -Property parameter, and if the -Property parameter isn’t defined it does nothing. I suspect that might be what you are running into.
Those properties are added by PowerShell, pretty much “at the last minute” as the results come back. You can’t remove them inside the Invoke-Command because they don’t exist there; you would need to remove them on your local computer, as it’s receiving the results.
Thanks Craig you saved me again. Your probably not use to answering rubbish questions like mine but again I’m two weeks into learning the power of PowerShell.
Cheers Don, I should of remembered that from your PowerShell CBT’s as you did cover that (on info overload at the moment). By the way your PowerShell nuggets are the best. I knew zero about PowerShell couple of weeks back.