@@ -28,8 +28,6 @@ Only web credentials can be displayed in cleartext.
28
28
[CmdletBinding ()] Param ()
29
29
30
30
$OSVersion = [Environment ]::OSVersion.Version
31
- $OSMajor = $OSVersion.Major
32
- $OSMinor = $OSVersion.Minor
33
31
34
32
# region P/Invoke declarations for vaultcli.dll
35
33
$DynAssembly = New-Object System.Reflection.AssemblyName(' VaultUtil' )
@@ -79,7 +77,7 @@ Only web credentials can be displayed in cleartext.
79
77
$null = $TypeBuilder.DefineField (' pResourceElement' , [IntPtr ], ' Public' )
80
78
$null = $TypeBuilder.DefineField (' pIdentityElement' , [IntPtr ], ' Public' )
81
79
$null = $TypeBuilder.DefineField (' pAuthenticatorElement' , [IntPtr ], ' Public' )
82
- if ($OSMajor -ge 6 -and $OSMinor -ge 2 )
80
+ if ($OSVersion -ge ' 6.2 ' )
83
81
{
84
82
$null = $TypeBuilder.DefineField (' pPackageSid' , [IntPtr ], ' Public' )
85
83
}
@@ -149,7 +147,7 @@ Only web credentials can be displayed in cleartext.
149
147
[Runtime.InteropServices.CallingConvention ]::Winapi,
150
148
[Runtime.InteropServices.CharSet ]::Auto)
151
149
152
- if ($OSMajor -ge 6 -and $OSMinor -ge 2 )
150
+ if ($OSVersion -ge ' 6.2 ' )
153
151
{
154
152
$PInvokeMethod = $TypeBuilder.DefinePInvokeMethod (' VaultGetItem' ,
155
153
' vaultcli.dll' ,
@@ -317,7 +315,7 @@ Only web credentials can be displayed in cleartext.
317
315
318
316
$PasswordVaultItem = [IntPtr ]::Zero
319
317
320
- if ($OSMajor -ge 6 -and $OSMinor -ge 2 )
318
+ if ($OSVersion -ge ' 6.2 ' )
321
319
{
322
320
$Result = $Vaultcli ::VaultGetItem($VaultHandle ,
323
321
[Ref ] $CurrentItem.SchemaId ,
0 commit comments