Here's an example of how to pull apart the HRESULT without using -BAND (and having to reverse bit counts and shift results).
As for a complete list of Windows error coded, there are thousands of them (probably tens of thousands!). If you want to build your own (SMALL!) subset of error to use in your code, use the Windows Error tool: https://learn.microsoft.com/en-us/windows/win32/debug/system-error-code-lookup-tool
# reference https://en.wikipedia.org/wiki/HRESULT
# 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 MEMORY
# 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
# S R C N X ----- Facility --- ----------- Code -------------- FIELDS
# 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0x80070005 (example)
#
# 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 INDEX
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
[int32]$HRESULT = 0x80070005
[string]$a = [convert]::ToString($HRESULT,2)
$facility = [Convert]::ToInt32( ($a[5..15] -join "") , 2)
$code = [Convert]::ToInt32( ($a[16..31] -join ""), 2)
"0x{0:X2}" -f $facility # in hexadecimal
"0x{0:X8}" -f $code # in hexadecimal
# system error codes (LOTS of them!) here: https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes