Get-Module cmdlet 列出了已导入或可导入到 PowerShell 会话中的 PowerShell 模块。 如果没有参数,Get-Module 获取已导入到当前会话中的模块。 ListAvailable 参数用于列出可从 PSModulePath 环境变量($Env:PSModulePath)中指定的路径导入的模块。
示例 PSC:\Users\admin>Get-Module-ListAvailable 目录: C:\Program Files\WindowsPowerShell\Modules ModuleType Version Name ExportedCommands---Script 1.0.1 Microsoft.PowerShell.Operation.V...{Get-OperationValidat...Binary 1.0.0.1 PackageManagement{Find-Package,Get-Pa...Script 3.4.0 Pester{Describe,C...
Cmdlet Get-Module 會列出已匯入或可匯入 PowerShell 會話的 PowerShell 模組。 如果沒有參數, Get-Module 取得已匯入目前會話的模組。 ListAvailable 參數可用來列出可從 PSModulePath 環境變數中指定的路徑匯入的模組, ($env:PSModulePath)。傳回的模組物件 Get-Module 包含有關模組的寶貴資訊。 您也可以使用...
模块: PowerShellGet 从联机库中下载指定模块的最新版本,并将其安装到本地计算机。 语法 PowerShell 复制 Update-Module [[-Name] <String[]>] [-RequiredVersion <String>] [-MaximumVersion <String>] [-Credential <PSCredential>] [-Scope <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>...
PowerShellGet 参考 反馈 本文档介绍PowerShellGet模块版本 3.0.22-beta22。 提供此模块是为了与PowerShellGetv2.2.x 兼容。 此版本的模块中的 cmdlet 是调用Microsoft.PowerShell.PSResourceGet模块中等效 cmdlet 的代理 cmdlet。 代理cmdlet 为使用版本 2.x cmdlet 的脚本提供兼容性层。 在大多数情况下,脚本将继...
CmdletUpdate-Module會從線上資源庫安裝模組的最新版本。 系統會提示您在安裝更新之前確認更新。 更新只會針對安裝在本機電腦上的Install-Module模組安裝。Update-Module搜尋$env:PSModulePath已安裝的模組。 這是Microsoft.PowerShell.PSResourceGet中 Cmdlet 的 Proxy CmdletUpdate-PSResource。 如需詳細資訊,請參閱Upda...
git clone https://github.com/PowerShell/PowerShellGet Navigate to the source directory cd path/to/PowerShellGet Import the module Import-Modulesrc/PowerShellGet-Force Code of Conduct Please see ourCode of Conductbefore participating in this project. ...
powershellCopy Code # 获取一个已存在的分区(这里选择第一个磁盘上的第一个分区,可以根据实际情况调整) $partition = Get-Partition -DiskNumber 1 -PartitionNumber 1 # 挂载分区到一个空闲驱动器号 Add-PartitionAccessPath -Partition $partition -AssignDriveLetter # 卸载分区(移除驱动器号) Remove-PartitionAc...
PowerShell Copy $Counter = Get-Counter -Counter "\Processor(*)\% Processor Time" $Counter.CounterSamples[0] Path InstanceName CookedValue --- --- --- \\Computer01\processor(0)\% processor time 0 1.33997091699662 Get-Counter uses the Counter parameter to specify the counter \Processor(*...
Module: Microsoft.PowerShell.Security Gets a credential object based on a user name and password. Syntax PowerShellCopy Get-Credential[[-Credential] <PSCredential>] [<CommonParameters>] PowerShellCopy Get-Credential[-Message <String>] [[-UserName] <String>] [-Title <String>] [<CommonParameter...