FunctionApp/Modules/SessionHostReplacer/internal/functions/ConvertTo-CaseInsensitiveHashtable.ps1 (12 lines of code) (raw):
function ConvertTo-CaseInsensitiveHashtable {
param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[hashtable]
$Hashtable
)
$ciHashtable = [hashtable]::new([System.StringComparer]::InvariantCultureIgnoreCase)
$Hashtable.Keys | ForEach-Object {
$ciHashtable[$_] = $Hashtable[$_]
}
return $ciHashtable
}