Display Loaded and Available Modules in Windows PowerShell
2016-02-03 15:04
771 查看
We don't need to Import module in powershell V3.
Windows PowerShell modules exist in two states: loaded and unloaded. To display a list of all loaded modules, you can use the Get-Module cmdlet without any parameters, as shown here:
PS C:\> Get-Module
If multiple modules are loaded when the Get-Module cmdlet is run, each module will be listed and its accompanying exported commands will appear on their own individual lines. If no modules are loaded, nothing is displayed to the Windows PowerShell console (no errors are displayed, and there is no confirmation that the command was actually run).
To obtain a listing of all modules that are available on the system but are not loaded into the Windows PowerShell console, you can use the Get-Module cmdlet with the ListAvailable parameter, as shown here:
PS C:\> Get-Module –ListAvailable
List All Cmdlets of a Specific Module in Powershell
sometime you need to know only some or all specific cmdlets for a module. For example you just imported an “Active Directory” Module and want to know which all cmdlets imported by it.
Let's import an module first.
Import-Module ActiveDirectory
ok, Module is imported,,now run the below command to list all cmdlets imported my “Active Directory” Module.
Get-Command –Module ActiveDirectory
So here is our all Active Directory Related Cmdlets.
How to know cmdlet belong to whcih module
Windows PowerShell modules exist in two states: loaded and unloaded. To display a list of all loaded modules, you can use the Get-Module cmdlet without any parameters, as shown here:
PS C:\> Get-Module
If multiple modules are loaded when the Get-Module cmdlet is run, each module will be listed and its accompanying exported commands will appear on their own individual lines. If no modules are loaded, nothing is displayed to the Windows PowerShell console (no errors are displayed, and there is no confirmation that the command was actually run).
To obtain a listing of all modules that are available on the system but are not loaded into the Windows PowerShell console, you can use the Get-Module cmdlet with the ListAvailable parameter, as shown here:
PS C:\> Get-Module –ListAvailable
List All Cmdlets of a Specific Module in Powershell
sometime you need to know only some or all specific cmdlets for a module. For example you just imported an “Active Directory” Module and want to know which all cmdlets imported by it.
Let's import an module first.
Import-Module ActiveDirectory
ok, Module is imported,,now run the below command to list all cmdlets imported my “Active Directory” Module.
Get-Command –Module ActiveDirectory
So here is our all Active Directory Related Cmdlets.
How to know cmdlet belong to whcih module
相关文章推荐
- PowerShell打开或关闭光驱
- PowerShell移动目录中指定文件的方法(非全部文件)
- Powershell小技巧之创建短网址
- PowerShell实现查询打开某个文件的默认应用程序
- PowerShell设置文件只读、隐藏属性的方法
- Windows Powershell扩展类型系统
- PowerShell脚本源码输出到文件的最佳写法
- Windows Powershell 通过函数扩展别名
- PowerShell脚本实现创建桌面快捷方式的方法
- PowerShell重启服务命令Restart-Service详细介绍
- PowerShell中执行Javascript的方法示例
- 探索PowerShell(十三) WMI对象介绍
- Powershell小技巧之使用Copy-Item添加程序到开机启动
- Windows Powershell创建对象
- Windows Powershell 访问数组
- Powershell小技巧之使用WS-Man来调用PowerShell命令
- PowerShell在控制台输出特殊符号的方法
- Windows Powershell使用哈希表
- PowerShell实现的文件同步脚本分享
- PowerShell中使用通配符匹配文件路径的例子