Relative Content

Tag Archive for powershellpowershell-core

When will pwsh wrap an object as psobject?

I am learning about Extended Type System from MSDN, I’ve learned the fact that all objects in pwsh has intrinsic members like psobject, pstypenames etc. Does this implies all object in pwsh is [psobject]? If it does, why does -is [psobject] returns false for some object like a native number literal 123. And I noticed that the object that’s not a [psobject] will be converted as [psobject] after being piped into a cmdlet. So there’s yet another question, when will pwsh implicitly convert an object into [psobject]? And when do we need to explicitly convert to it?