powershell - Test-Path issue -
why test-path -path $folder -pathtype container return true, folder not exist? path is:
c:\windows\system32\windowspowershell\v1.0\modules\mycompany\modules
same code in ise x86 , ise, different results
the answer here
excerpt:
the 'system32' folder 64-bit files , 'syswow64' folder 32-bit files
this can confusing, system32 folder intended 64-bit files , syswow64 folder intended 32-bit files.
this may seem bit illogical if @ folder names, there explanation this. has compatibility. many developers have hard coded path system folder in applications source code. have included "system32" in folder path. , preserve compatibility, if application converted 64-bit code, 64-bit system folder still named system32.
but 32-bit applications have system path hard coded , running in 64-bit windows? how can find new syswow64 folder without changes in program code, might think.
the answer emulator redirects calls system32 folder syswow64 folder transparently if folder hard coded system32 folder (like c:\windows\system32), emulator make sure syswow64 folder used instead. same source code, contains path system32 folder included, can compiled both 32-bit , 64-bit program code without changes.
so remember: • syswow64 folder intended 32-bit files • system32 folder intended 64-bit files important binary file compiled specific bitness (32 or 64) installed correct system folder. otherwise program needs file not able load file , not work expected.
that's why ise x86 output in syswow64 folder , call to:
c:\windows\system32\windowspowershell\v1.0\modules\mycompany\modules
is redirected syswow64 folder.
the ise console running x64 , therefore in system 32 , not find folder, folder created in ise x86 console, saves folder under syswow64.

