Starting Windows PowerShell with Import System Modules (2.0)

Mis à jour: octobre 2013

S'applique à: Windows PowerShell 2.0, Windows PowerShell 3.0, Windows PowerShell 5.0

This section explains how to start Windows PowerShell 2.0 with the Import System Modules task. The Import System Modules task starts a Windows PowerShell 2.0 session that includes commands from all modules in the %Windir%\System32\WindowsPowerShell\1.0\Modules directory. The session also runs with the privileges of the Administrator account (the Run as administrator option.

The Import System Modules task is available only Windows 7 and Windows Server 2008 R2 when Windows PowerShell 3.0 is not installed on the computer. Beginning in Windows PowerShell 3.0, modules are imported automatically the first time that you use a cmdlet in the module.

For more information about Windows PowerShell modules and automatic importing of modules ("module auto-loading"), see about_Modules and Using Modules and Snap-Ins.

To start Windows PowerShell with the Import System Modules task, use either of the following procedures.

To Start with "Import System Modules"

  • In the taskbar, right-click the Windows PowerShell icon, and then click Import System Modules.

  • Click Start, point to Administrative Tools and then click Windows PowerShell Modules.

Notes

In Windows Server 2008 R2, the Windows PowerShell icon is pinned to the taskbar by default. However, you must start Windows PowerShell one time to make the Import System Modules task appear.

In all supported versions of Windows, you can add all available modules to a Windows PowerShell session. Start Windows PowerShell and, at the Windows PowerShell prompt, type:

Get-Module -ListAvailable | Import-Module