File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2586,8 +2586,25 @@ $RemoteScriptBlock = {
2586
2586
#Load the PE reflectively
2587
2587
Write-Verbose "Calling Invoke-MemoryLoadLibrary"
2588
2588
2589
- if (((Get-WmiObject -Class Win32_Processor).AddressWidth / 8) -ne [System.Runtime.InteropServices.Marshal]::SizeOf([Type][IntPtr]))
2589
+ try
2590
2590
{
2591
+ $Processors = Get-WmiObject -Class Win32_Processor
2592
+ }
2593
+ catch
2594
+ {
2595
+ throw ($_.Exception)
2596
+ }
2597
+
2598
+ if ($Processors -is [array])
2599
+ {
2600
+ $Processor = $Processors[0]
2601
+ } else {
2602
+ $Processor = $Processors
2603
+ }
2604
+
2605
+ if ( ( $Processor.AddressWidth) -ne (([System.IntPtr]::Size)*8) )
2606
+ {
2607
+ Write-Verbose ( "Architecture: " + $Processor.AddressWidth + " Process: " + ([System.IntPtr]::Size * 8))
2591
2608
Write-Error "PowerShell architecture (32bit/64bit) doesn't match OS architecture. 64bit PS must be used on a 64bit OS." -ErrorAction Stop
2592
2609
}
2593
2610
You can’t perform that action at this time.
0 commit comments