Search notes:

System.Management.Automation.PSCustomObject

Creating a PSCustomObject in PowerShell

In PowerShell, an object whose type is System.Management.Automation.PSCustomObject can be created like so:
PS C:\> $obj = new-object psObject
PS C:\> $obj.GetType().FullName
System.Management.Automation.PSCustomObject

Adding properties (named values) to a PSCustomObject object

As all PowerShell objects, a PSCustomObject can be added properties, which are basically named values. This functionality is probably the main use for PSCustomObjects.
$psCustObj = new-object psObject
$psCustObj | add-member num  42
$psCustObj | add-member txt 'hello world'

write-host "num = $($psCustObj.num), txt = $($psCustObj.txt)"

'num', 'txt' | foreach-object { write-host "$_ : $($psCustObj.$_ )" }

Definition and significance of PSCustomObject

In the source code, PSCustomObject is defined like so (redacted by me for brevity):
public class PSCustomObject
{
    /// To prevent other instances than SelfInstance.
    private PSCustomObject() { }

    internal static PSCustomObject SelfInstance = new PSCustomObject();

    public override string ToString()
    {
        return string.Empty;
    }
}
So, PSCustomObject directly derives from System.Object, does not implement any interface and does not have any fields or properties except the internal field SelfInstance.
A PSCustomObject is used to initialize a PSObject if the PSObject does not refer to any other .NET class (and thus essentially becomes a custom-object). See PSObject, its base object and PSCustomObject.

See also

System.Management.Automation.PSObject

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1740452954, '18.220.7.70', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/dot-net/namespaces-classes/System/Management/Automation/PSCustomObject(80): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78