@@ -167,13 +167,19 @@ def printCreds(self, context, output):
167167 # When powershell returns something else than the usernames and passwords account.split() will throw a ValueError.
168168 # This is likely an error thrown by powershell, so we print the error and the output for debugging purposes.
169169 try :
170+ context .log .highlight (f"{ 'Username' :<30} { 'Password' :<30} { 'Description' } " )
171+ context .log .highlight (f"{ '--------' :<30} { '--------' :<30} { '-----------' } " )
170172 for account in output_stripped :
171- user , password = account .split (" " , 1 )
172- password = password .strip ().replace ("WHITESPACE_ERROR" , " " )
173- user = user .strip ()
174- context .log .highlight (f"{ user } :{ password } " )
175- if " " in password :
176- context .log .fail (f'Password contains whitespaces! The password for user "{ user } " is: "{ password } "' )
173+ # Remove multiple whitespaces
174+ account = " " .join (account .split ())
175+ try :
176+ user , password , description = account .split (" " , 2 )
177+ except ValueError :
178+ user , password = account .split (" " , 1 )
179+ user = user .strip ().replace ("WHITESPACE_ERROR" , " " ).strip ()
180+ password = password .strip ().replace ("WHITESPACE_ERROR" , " " ).strip ()
181+ description = description .strip ().replace ("WHITESPACE_ERROR" , " " ).strip ()
182+ context .log .highlight (f"{ user :<30} { password :<30} { description } " )
177183 except ValueError :
178184 context .log .fail (f"Powershell returned unexpected output: { output_stripped } " )
179185 context .log .fail ("Please report this issue on GitHub!" )
0 commit comments