Converting byte arrays to hex, e.g. Thumbprint in Get-DBADbCertificate, or SID in Get-DBALogin #9486
Unanswered
TallGuyPNW
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@TallGuyPNW You can use something like this:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I realize that this is likely more of a PowerShell question than specifically a dbatools question, but how do I convert byte arrays returned by various dbatools commands into hex values?
For example:
$dataTable = Get-DbaDbCertificate -sqlinstance serverinstancenamehere |`
select-object @{Label="DatabaseName";Expression={$.Database}},
@{Label="CertificateName";Expression={$.Name}},
Owner,
Thumbprint
I see rows for each certificate, with values like {111, 93, 151, 17…} for the Thumbprint, but I want to convert that to the hex value 0x6f5d9711...., into the Thumbprint property in $dataTable for each row returned by Get-DBAdbCertificate. Is there some sort of conversion function I can use in-line in the select-object? Does anyone have an example I can use?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions