Skip to content

Commit f94de39

Browse files
authored
Update Determine_the_process_bitness.ps1
1 parent 4421c42 commit f94de39

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Determine_the_process_bitness.ps1

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# https://rkeithhill.wordpress.com/2014/04/28/how-to-determine-if-a-process-is-32-or-64-bit/
2-
32
function ProcessBitness
43
{
54
param
@@ -14,11 +13,8 @@ function ProcessBitness
1413
Name = "Bitness"
1514
Language = "CSharp"
1615
MemberDefinition = @"
17-
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
18-
[return: MarshalAs(UnmanagedType.Bool)]
19-
public static extern bool IsWow64Process(
20-
[In] System.IntPtr hProcess,
21-
[Out, MarshalAs(UnmanagedType.Bool)] out bool wow64Process);
16+
[DllImport("kernel32.dll")]
17+
public static extern bool IsWow64Process(System.IntPtr hProcess, [Out] out bool wow64Process);
2218
"@
2319
}
2420
if (-not ("Kernel32.Bitness" -as [type]))
@@ -41,3 +37,4 @@ public static extern bool IsWow64Process(
4137
}
4238
}
4339
}
40+
ProcessBitness -ProcessName pwsh

0 commit comments

Comments
 (0)