示例31: 使用 PowerShell Core 进行跨平台磁盘管理 powershellCopy Code #在 PowerShell Core 中执行磁盘和分区管理 Invoke-Command -ComputerName "Server01" -ScriptBlock { Get-Volume | Where-Object { $_.DriveLetter -eq 'E' } | Format-List } 示例32: 磁盘性能优化和调整 powershellCopy Code # 优...
Cmdlet Find-Script 會在已註冊的存放庫中尋找指定的腳本。 這是Microsoft.PowerShell.PSResourceGet中Cmdlet 的 Proxy Cmdlet Find-PSResource。 如需詳細資訊,請參閱 Find-PSResource。 範例 範例1:依名稱尋找腳本 PowerShell 複製 Find-Script -Name "Start-WFContosoServer" 此命令會尋找名為 的 Start-WFCont...
PowerShell复制 Publish-Script-LiteralPath<String> [-NuGetApiKey <String>] [-Repository <String>] [-Credential <PSCredential>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] 说明 cmdletPublish-Script将指定的脚本发布到联机库。 这是Microsoft.PowerShell.PSResourceGet中 cmdlet 的代理Publish-PS...
从该位置开始, 无需使用 Path 参数来获取特定于提供程序的帮助Get-Help。 PowerShell 复制 Get-Help Get-Item -Path SQLSERVER:\DataCollection NAME Get-Item SYNOPSIS Gets a collection of Server objects for the local computer and any computers to which you have made a SQL Server PowerShell ...
PowerShell 公用程式模組 PSScriptAnalyzer 參考 閱讀英文版本 TwitterLinkedInFacebook電子郵件 參考 意見反應 模組: PSScriptAnalyzer 取得本機電腦上的腳本分析器規則。 Syntax PowerShell Get-ScriptAnalyzerRule[[-Name] <string[]>] [-CustomRulePath <string[]>] [-RecurseCustomRulePath] [-Severity <string[...
PowerShell Get-Help-NameC:\PS-Test\MyScript.ps1 参数 -Category 只显示指定类别及其别名中的项的帮助。 概念文章位于HelpFile类别中。 此参数的可接受值如下所示: 别名 Cmdlet 供应商 常规 常见问题 词汇表 HelpFile ScriptCommand 功能 滤波器 ExternalScript ...
PowerShellGet 使用元数据创建脚本文件。 语法 PowerShell New-ScriptFileInfo[[-Path] <String>] [-Version <String>] [-Author <String>]-Description<String> [-Guid <Guid>] [-CompanyName <String>] [-Copyright <String>] [-RequiredModules <Object[]>] [-ExternalModuleDependencies <String[]>] [...
PowerShell 复制 Get-WinEvent -Path 'C:\Test\PowerShellCore Operational.evtx' -MaxEvents 100 ProviderName: PowerShellCore TimeCreated Id LevelDisplayName Message --- -- --- --- 3/15/2019 09:54:54 4104 Warning Creating Scriptblock text (1 of 1):... 3/15/2019 09:37:13 40962 Inform...
PowerShell Get-Help-NameC:\PS-Test\MyScript.ps1 参数 -Category 只显示指定类别及其别名中的项的帮助。 概念文章位于HelpFile类别中。 此参数的可接受值如下所示: 别名 Cmdlet 供应商 常规 常见问题 词汇表 HelpFile ScriptCommand 功能 滤波器 ExternalScript ...
首先,你需要下载和安装PowerShell 5.0http://go.microsoft.com/fwlink/?LinkId=398175 安装完成后,启动PowerShell ISE (Powershell_ise.exe),在PowerShell console中,键入如下命令。 Install-Module ScriptBrowser –Scope CurrentUser 安装完成后,你可以键入以下命令运行script browser和script analyzer ...