Quantcast
Channel: Remote Desktop Services (Terminal Services) forum
Viewing all articles
Browse latest Browse all 1106

PS Script - import powershell modules requiring PS x86 for some modules and PS x64 for other modules

$
0
0

Hi,
I have a PS script that creates a VM on VCenter, join it to the domain, adds RDSH 2012 r2 role then add it
to the appropriate RDS collection.

For that, I import 3 powershell modules :

 

#Import required Modules & Snapins
 Import-Module ActiveDirectory
 Import-Module RemoteDesktop
 Add-PSsnapin VMware.VimAutomation.Core

This runs (appearently) OK from both x86 and x64 powershell command line Windows or ISE
But when running the script itself witch both calls RemoteDesktop ps commandlets
and  VMware.VimAutomation.Core's snapin commandlets, things turn Red. 

from a x64 window PS window, I get :
New-OSCustomizationSpec : This cmdlet requires 32bit process. Please run PowerCLI in 32 bit mode.

from a x86 window PS window, I get :  
Import-Module : The specified module 'RemoteDesktop' was not loaded because no valid module file was found
in any module directory.

At line:3 char:2

+  Import-Module RemoteDesktop

+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (RemoteDesk

    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand


This is the first time I encounter this.

Any Help Please ?


MCTS Windows Server Virtualization, Configuration


Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>