Skip to content

Commit

Permalink
Update PasswordResult Class for compatibility with PasswordState v9 (#…
Browse files Browse the repository at this point in the history
…135)

* Changed Encoding for the HTTP POST/PUT/DELETE Actions to UTF-8 to include culture dependent characters (german umlauts etc.)

* Update to make PasswordResult Class compatible with new fields returned from the passwords api method (GenericFieldInfo and OTP)
  • Loading branch information
eizedev authored Mar 8, 2021
1 parent 77da897 commit f362f75
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/functions/PasswordStateClass.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ class PasswordResult {
}
$user += "$($this.Username)"
}

If ($this.Password.GetType().Name -ne 'String') {
$output = [PSCredential]::new($user, $this.Password.Password)
return $output
}

Else{
if($this.Password.Length -lt 1){
Else {
if ($this.Password.Length -lt 1) {
return $null
}
$output = [PSCredential]::new($user, $(ConvertTo-SecureString -String $this.Password -AsPlainText -Force))
Expand All @@ -82,12 +81,14 @@ class PasswordResult {
[String]$GenericField8
[String]$GenericField9
[String]$GenericField10
[System.Array]$GenericFieldInfo
[Nullable[System.Int32]]$AccountTypeID
[string]$Notes
[string]$URL
[string]$ExpiryDate
[System.Boolean]$AllowExport
[string]$AccountType
[System.Array]$OTP
# Constructor used to initiate the default property set.
PasswordResult() {
[string[]]$DefaultProperties = 'PasswordID', 'Title', 'Username', 'Password', 'Description', 'Domain'
Expand Down

0 comments on commit f362f75

Please sign in to comment.