模块: PowerShellGet 发布脚本。 语法 PowerShell 复制 Publish-Script -Path <String> [-NuGetApiKey <String>] [-Repository <String>] [-Credential <PSCredential>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] Powe
Install-Script 參考 意見反應 模組: PowerShellGet 安裝腳本。 語法 PowerShell複製 Install-Script[-Name] <String[]> [-MinimumVersion <String>] [-MaximumVersion <String>] [-RequiredVersion <String>] [-Repository <String[]>] [-Scope <String>] [-NoPathUpdate] [-Proxy <Uri>] [-ProxyCredential...
powershellCopy Code # 在远程计算机上操作注册表 $session = New-PSSession -ComputerName "RemoteComputerName" Invoke-Command -Session $session -ScriptBlock { Get-ItemProperty -Path "HKLM:\Software\MyApp" } Remove-PSSession -Session $session 这些技巧和方法能够帮助你更全面、高效地利用 PowerShell 来管理...
表1:用于在 PowerShell 库中查找内容的 Cmdlet Cmdlet说明 Find-Module使用此 cmdlet 在 PowerShell 库中搜索 Windows PowerShell 模块。 最简单的用法是根据模块名进行搜索,但也可以根据命令名、版本、DscResource 和 RoleCapability 进行搜索。 Find-Script使用此 cmdlet 在 PowerShell 库中搜索 Wi...
-Path获取说明 cmdlet 在指定的提供程序路径中的工作方式的帮助。 输入 PowerShell 提供程序路径。 此参数获取 cmdlet 帮助文章的自定义版本,该文章介绍了 cmdlet 在指定的 PowerShell 提供程序路径中的工作原理。 此参数仅适用于有关提供程序 cmdlet 的帮助,并且仅当提供程序在其帮助文件中包含提供程序 cmdlet 帮助...
Get-CMTSStepRunPowerShellScript [-TaskSequenceId] <String> [-StepName <String>] [-WhatIf] [-Confirm] [<CommonParameters>]PowerShell Копировать Get-CMTSStepRunPowerShellScript [-TaskSequenceName] <String> [-StepName <String>] [-WhatIf] [-Confirm] [<CommonParameters>]О...
示例31: 使用 PowerShell Core 进行跨平台磁盘管理 powershellCopy Code #在 PowerShell Core 中执行磁盘和分区管理 Invoke-Command -ComputerName "Server01" -ScriptBlock { Get-Volume | Where-Object { $_.DriveLetter -eq 'E' } | Format-List } 示例32: 磁盘性能优化和调整 powershellCopy Code # 优...
PowerShell Get-Help-NameC:\PS-Test\MyScript.ps1 参数 -Category 只显示指定类别及其别名中的项的帮助。 概念文章位于HelpFile类别中。 此参数的可接受值如下所示: 别名 Cmdlet 供应商 常规 常见问题 词汇表 HelpFile ScriptCommand 功能 滤波器 ExternalScript ...
PowerShell 複製 Get-Help -Name C:\PS-Test\MyScript.ps1參數-Category僅針對指定類別及其別名中的項目顯示說明。 概念性文章位於 HelpFile 類別中。 此參數可接受的值如下: 別名 Cmdlet 供應商 一般 常見問題 詞彙表 HelpFile ScriptCommand 功能 濾波器 ExternalScript 所有 DefaultHelp 工作流程 DscResource ...
PowerShell 复制 Get-Member [-InputObject <PSObject>] [[-Name] <String[]>] [-MemberType <PSMemberTypes>] [-View <PSMemberViewTypes>] [-Static] [-Force] [<CommonParameters>] 说明 Get-Member cmdlet 获取对象的成员、属性和方法。 若要指定对象,请使用 InputObject 参数或管道将对象 Get-Member...