marabunta

PSCustomObject

Hallo,

wie bekomme ich einfach eine Liste? Bei diesem und mit += klappts nicht.

$Passwordliste=[PSCustomObject]@{
    Bezeichnung = $Bezeichnung
    LoginName = $LoginName
    Password = $Password
    }
    $AllPasswords=$Passwordliste

Danke.
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 608409

Url: https://administrator.de/forum/pscustomobject-608409.html

Ausgedruckt am: 05.05.2025 um 03:05 Uhr

145916
Lösung 145916 29.09.2020 aktualisiert um 11:09:12 Uhr
Goto Top
Zitat von @Marabunta:

Hallo,

wie bekomme ich einfach eine Liste? Bei diesem und mit += klappts nicht.

Doch du hast nur vergessen das Array dem das Objekt hinzugefügt werden soll vorher entsprechend anzulegen...
🙂

$AllPasswords = @()
$Passwordliste=[PSCustomObject]@{
    Bezeichnung = $Bezeichnung
    LoginName = $LoginName
    Password = $Password
}
$AllPasswords += $Passwordliste
$AllPasswords

Btw. "Passwordliste" denglischer wird's nimmer 😉