我需要在我的环境中的各种机器上安装Bitlocker相关模块。我无法手动一个接一个地安装它。我需要自动安装。有人能指出我正确的方向,并提供给我指针。如何通过PowerShell脚本本身在多台机器上安装PowerShell模块
我在这找不到任何以前的问题。我看到下面的问题,但我们没有在所有机器上的NuGet。 Use nuget to install PowerShell modules at user machine
我需要在我的环境中的各种机器上安装Bitlocker相关模块。我无法手动一个接一个地安装它。我需要自动安装。有人能指出我正确的方向,并提供给我指针。如何通过PowerShell脚本本身在多台机器上安装PowerShell模块
我在这找不到任何以前的问题。我看到下面的问题,但我们没有在所有机器上的NuGet。 Use nuget to install PowerShell modules at user machine
您可以利用PowerShell Gallery功能。
先决条件:确保您拥有PowerShellGet模块。此模块附带Windows Management Framework(WMF)5.0,或者您可以使用基于MSI的安装程序,并将其包含在PowerShell 3和4.您可以通过SCCM将其推送,如果它尚未存在。
必需的Cmdlet:使用下面的cmdlet执行所需的操作。您可以在脚本中使用这些cmdlet,并针对环境中的多台计算机运行这些cmdlet。
#Check if module exists using Find-Module cmdlet
Find-Module xBitlocker
#Install the module using the Install-Module cmdlet
Install-Module -Name xBitlocker -Force
#Check module is on current machine already using below cmdlet
Get-Module -Name xBitlocker
#Save the module on local machine without installing
Save-Module -Name xBitlocker -Path <path here>
#Install the module using the below cmdlet
Uninstall-Module -Name xBitlocker -Force
您可以使用这些cmdlet并创建脚本以针对多台机器运行。 您也可以使用另一个模块名称更改xBitlocker
。
哇,这是快。我会试试看。谢谢。 –