I'm using DBATools Module Invoke-DBQQuery ( based on Invoke-SQLCMD2) to query a SQL database. The query returns single record as a PSObject called $Results that looks like this...
FileName : C12345
BADGENUMBER : BADGENUMBER=12345
LASTNAME : LASTNAME=SMITH
FIRSTNAME : FIRSTNAME=JOHN
CIA : CIA=YES
SOCIALSECURITY : SOCIALSECURITY=999999999
DACDATE : DACDATE=07/16/2022
UIC : UIC=42158
I need to output this PSObject to a TXT file with just the values no Field Titles one field on each row. that looks like this...
C12345
BADGENUMBER=12345
LASTNAME=SMITH
FIRSTNAME=JOHN
CIA=YES
SOCIALSECURITY=999999999
DACDATE=07/16/2022
UIC=42158
How do I go about producing the test file in the format I need?
$Results| Out-File c:\test.test.txt
produces the first output I listed.
Appreciate any assistance anyone can provide.
-MARK-