marabunta
Goto Top

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.

Content-Key: 608409

Url: https://administrator.de/contentid/608409

Printed on: April 25, 2024 at 09:04 o'clock

Mitglied: 145916
Solution 145916 Sep 29, 2020 updated at 09:09:12 (UTC)
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 😉