Skip to content

Commit 468abea

Browse files
committed
WOW6432 Crippled for testing
1 parent 2d9e284 commit 468abea

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

LabTech.psm1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ $ModuleVersion = "1.5"
4343
If ($env:PROCESSOR_ARCHITEW6432 -match '64' -and [IntPtr]::Size -ne 8) {
4444
Write-Warning '32-bit PowerShell session detected on 64-bit OS. Attempting to launch 64-Bit session to process commands.'
4545
$pshell="${env:WINDIR}\sysnative\windowspowershell\v1.0\powershell.exe"
46+
Write-Debug "Launch Context: $($myInvocation | out-String)"
4647
If (!(Test-Path -Path $pshell)) {
4748
Write-Warning 'SYSNATIVE REDIRECTION IS NOT AVAILABLE. Attempting to access 64bit binaries directly.'
4849
$pshell="${env:WINDIR}\System32\WindowsPowershell\v1.0\powershell.exe"
@@ -53,15 +54,14 @@ public static extern bool Wow64DisableWow64FsRedirection(ref IntPtr ptr);
5354
"@
5455
$Kernel32 = Add-Type -MemberDefinition $MethodSignature -Namespace "Kernel32" -Passthru -Name DisableWow64Redirection
5556
[ref]$ptr = New-Object System.IntPtr
56-
$Result = $Kernel32::Wow64DisableWow64FsRedirection($ptr) # Now you can call 64-bit Powershell from system32
57+
# $Result = $Kernel32::Wow64DisableWow64FsRedirection($ptr) # Now you can call 64-bit Powershell from system32
5758
}
58-
Write-Debug "Launch Context: $($myInvocation | out-String)"
5959
If ($myInvocation.Line) {
60-
&"$pshell" -NonInteractive -NoProfile $myInvocation.Line
60+
Write-Output '&"$pshell" -NonInteractive -NoProfile $myInvocation.Line'
6161
} Elseif ($myInvocation.InvocationName) {
62-
&"$pshell" -NonInteractive -NoProfile -File "$($myInvocation.InvocationName)" $args
62+
Write-Output '&"$pshell" -NonInteractive -NoProfile -File "$($myInvocation.InvocationName)" $args'
6363
} Else {
64-
&"$pshell" -NonInteractive -NoProfile $myInvocation.MyCommand
64+
Write-Output '&"$pshell" -NonInteractive -NoProfile $myInvocation.MyCommand'
6565
}
6666
$ExitResult=$LASTEXITCODE
6767
If ($FSRedirection -eq $True) {
@@ -71,7 +71,7 @@ public static extern bool Wow64RevertWow64FsRedirection(ref IntPtr ptr);
7171
"@
7272
$Kernel32Default = Add-Type -MemberDefinition $MethodSignature -Namespace "Kernel32" -Passthru -Name RevertWow64Redirection
7373
[ref]$defaultptr = New-Object System.IntPtr
74-
$Result = $Kernel32Default::Wow64RevertWow64FsRedirection($defaultptr)
74+
# $Result = $Kernel32Default::Wow64RevertWow64FsRedirection($defaultptr)
7575
}
7676
Write-Warning 'Exiting 64-bit session. Module will only remain loaded in native 64-bit PowerShell environment.'
7777
Exit $ExitResult

0 commit comments

Comments
 (0)