Powershell and overriden comparision operators

Question:

How can one create an object that when its operators, such as:

, are overridden PowerShell utilizes these operators?

Such that:

would call:

Is it possible?

To clarify:

  • The object exists within a .NET assembly
  • The object has overridden comparision operators
  • PowerShell does not seem to honor these operators

Answer:

I do not believe you can do operator overloading in Powershell.

Source:

Powershell and overriden comparision operators by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply