This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Powershell x86 query not working

I am getting weird problem. On running the query on 64 bit powershell, it is running successfully, However when i am running the same on x86 query does not gives any output. 

what could be the problem ?

X86 query 

$query = 'SELECT TOP '+ $selectCount +' I.Status,I.DisplayName FROM IPAM.IPNode I WHERE Status=2 AND I.Subnet.VLAN = '''+$VlanID +''''
$availableIp = Get-SwisData -SwisConnection $swis -Query $query

x64 Query

$query = 'SELECT TOP '+ $selectCount +' I.Status,I.DisplayName FROM IPAM.IPNode I WHERE Status=2 AND I.Subnet.VLAN = '''+$VlanID +''''
$availableIp = Get-SwisData -SwisConnection $swis -Query $query

  • Is the Connect-Swis portion working correctly (generating your $Swis variable)?  If that part fails, it might be that the PowerShell x86 doesn't recognize the SwisPowerShell module.  More recent versions of the shell will automatically import modules as needed, but I think that was a Windows PowerShell 5.1 and later thing.

    Can you share your error messages and the output of $PSVersionTable while in the x86 shell?

  • There's two boolean static methods in the Environment you can inspect and compare, one looks at the PowerShell process, one looks at the underlying upsers OS.

    if ([Environment]::Is64BitProcess -ne [Environment]::Is64BitOperatingSystem)
    {
    "PowerShell process does not match the OS"
    }