fix: PS 5.1 Sac-Client JSON types without uint alias 2.0.2-SAC

Replace [uint]/[ulong] -is checks with GetType().IsPrimitive for Windows PowerShell 5.1 on domain hosts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-06-01 09:13:19 +10:00
parent 084494cfa8
commit d54d04623f
4 changed files with 5 additions and 6 deletions
+2 -3
View File
@@ -173,9 +173,8 @@ function Convert-AnyToJsonSerializable {
if ($Value -is [string] -or $Value -is [bool] -or $Value -is [char]) {
return $Value
}
if ($Value -is [byte] -or $Value -is [sbyte] -or $Value -is [int16] -or $Value -is [uint16] -or
$Value -is [int] -or $Value -is [uint] -or $Value -is [long] -or $Value -is [ulong] -or
$Value -is [float] -or $Value -is [double] -or $Value -is [decimal]) {
# PS 5.1: нет алиасов [uint]/[ulong] — IsPrimitive покрывает все числовые типы.
if ($Value.GetType().IsPrimitive) {
return $Value
}
if ($Value -is [datetime] -or $Value -is [datetimeoffset] -or $Value -is [guid]) {