سؤال

أنا أعمل مع تطبيق 32 بت يمكنه تشغيل مقتطفات بوويرشيل.أنا بحاجة لتحميل ServerManager الوحدة النمطية، والتي سأفعلها عادةً باستخدام:

Import-Module ServerManager

لكني أتلقى هذا الخطأ:

لم يتم تحميل الوحدة النمطية المحددة "ServerManager" لأنه لم يتم العثور على ملف وحدة صالح في أي دليل وحدة.

أفترض أن السبب في ذلك هو أن وحدة ServerManager غير موجودة في دليل الوحدات النمطية 64 بت، لذلك حاولت ما يلي:

Import-Module "C:\Windows\sysnative\WindowsPowerShell\v1.0\Modules\ServerManager"

ولكن الآن أحصل على الخطأ:

Import-Module : Cannot load Windows PowerShell snap-in C:\Windows\assembly\GAC_MSIL\Microsoft.Windows.ServerManager.PowerSh
ell\6.1.0.0__31bf3856ad364e35\Microsoft.Windows.ServerManager.PowerShell.dll because of the following error: Unable to load
 one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Loader Exceptions: 

Could not load file or assembly 'Microsoft.Windows.ServerManager, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856
ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Windows.ServerManager, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856
ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Windows.ServerManager, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856
ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Windows.ServerManager, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856
ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Windows.ServerManager, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856
ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Windows.ServerManager, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856
ad364e35' or one of its dependencies. The system cannot find the file specified.
At line:1 char:14

هل هناك أي اقتراحات حول كيفية استخدام وحدة ServerManager من خلال Powershell 32 بت؟أو اقتراح آخر حول كيفية تثبيت ميزة "تجربة سطح المكتب" على Server 2008 R2 (بدون استخدام واجهة المستخدم)؟

هل كانت مفيدة؟

المحلول

خيارك الحقيقي الوحيد هنا هو إنشاء نسخة 64 بت من powershell.exe لمعالجة أوامر مدير الخادم لديك.نظرًا لأن العملية الأصلية هي 32 بت، فسيتعين عليك استخدام نفس العملية %windir%\sysnative خدعة لتشغيل powershell.exe.

%windir%\sysnative\windowspowershell\v1.0\powershell.exe 
     -command '& { ipmo servermanager; add-windowsfeature foo }'

(ملفوفة من أجل الوضوح)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top