Private/Get-IntuneAccessByteHash.ps1
|
function Get-IntuneAccessByteHash { [CmdletBinding()] param([Parameter(Mandatory)][AllowEmptyCollection()][byte[]]$Bytes) # Instance hashing and BitConverter also work on .NET Core 3.1 (PowerShell 7.0). $algorithm=[Security.Cryptography.SHA256]::Create() try { ([BitConverter]::ToString($algorithm.ComputeHash($Bytes))).Replace('-','').ToLowerInvariant() } finally { $algorithm.Dispose() } } |