Private/Get-ApplianceSerialNumbers.ps1

function Get-ApplianceSerialNumbers {
    <#
    .SYNOPSIS
        Gets the serial numbers of installed harddrives, memory chips and motherboard
    .DESCRIPTION
        Long description
    .EXAMPLE
        Example of how to use this cmdlet
    #>

    
        # Seriennummern aller Laufwerke ermitteln
        Get-CimInstance CIM_DiskDrive | Select-Object SerialNumber | ForEach-Object -Process {$ApplianceSerialNumbers += @($_.SerialNumber)}
        # Seriennummern aller RAM-Chips ermitteln
        Get-CimInstance CIM_Chip | Select-Object SerialNumber | ForEach-Object -Process {$ApplianceSerialNumbers += @($_.SerialNumber)}
        # Seriennummer des Motherboards ermitteln
        Get-CimInstance CIM_BIOSElement | Select-Object SerialNumber| ForEach-Object -Process {$ApplianceSerialNumbers += @($_.SerialNumber)}
    
        $ApplianceSerialNumbers
    }