第二個參數集包含List參數,這是 switch 參數。 當您指定List參數時,它會傳回本機電腦上的事件記錄清單。 Syntax [-List] 語法的簡化方法 除了純英文以外,還有更方便使用的方法可取得與某些命令的神秘命令語法相同的資訊。 使用Get-Help搭配Full參數時,PowerShell 會傳回完整的說明文章,讓您更容易瞭解命令的使用方...
[Parameter] public SwitchParameter SimpleMatch { get { return simpleMatch; } set { simpleMatch = value; } } private bool simpleMatch; CaseSensitive 参数是一个开关参数,指示是否执行区分大小写的搜索。 当用户在命令行(true)上指定参数时,cmdlet 会在比较模式时检查大写和小写字符。 如果未指定...
Save-Help、Update-Help、Import-PSSession、Export-PSSession 和 Get-Command 皆有 ModuleSpecification 類型的新參數 FullyQualifiedModule。 您可新增這個參數來指定模組的完整名稱。 $PSVersionTable.PSVersion的值已經更新至 5.0。 WMF 5.0 (PowerShell 5.0) 包含了Pester模組。 Pester 是一種單元測試架構,適用於 ...
“打开模块日志记录”策略设置将打开所选 PowerShell 模块的日志记录。 此设置在所有受影响的计算机上的所有会话中都有效。 如果启用此策略设置并指定一个或多个模块,PowerShell 将在Windows PowerShell登录事件查看器中记录指定模块的管道执行事件。 如果禁用此策略设置,PowerShell 不会记录任何 PowerShell 模块的...
[ValidateUserDrive] [version] [void] [WildcardPattern] [wmi] [wmiclass] [wmisearcher] [X500DistinguishedName] [X509Certificate] [xml] 仅允许以下 COM 对象类型: Scripting.Dictionary Scripting.FileSystemObject VBScript.RegExp PowerShellNoLanguage模式完全禁用 PowerShell 脚本语言。 不能运行脚本或使用变量...
The WhatIf switch doesn't work in Security & Compliance PowerShell. The WhatIf switch simulates the actions of the command. You can use this switch to view the changes that would occur without actually applying those changes. You don't need to specify a value with this switch. Expand ...
The command uses an appropriate global catalog server automatically. You can only use the DN for the Identity parameter. Other forms of identification, such as alias or GUID, aren't accepted. Expand table Type: SwitchParameter Position: Named Default value: None Required: False Accept pipeline ...
$j=Start-Job-ScriptBlock{Get-WinEvent-LogSystem }-CredentialDomain01\User01$j|Select-Object-Property* State : Completed HasMoreData : True StatusMessage : Location : localhost Command :Get-WinEvent-LogSystem JobStateInfo : Completed Finished : System.Threading.ManualResetEvent InstanceId :27ce3fd...
Invoke-Command -ComputerName Server01 -Credential Domain01\User01 -ScriptBlock { Get-Culture } ComputerName 参数指定远程计算机的名称。 凭据参数用于在 Domain01\User01(有权运行命令的用户)的安全上下文中运行该命令。 ScriptBlock 参数指定要在远程计算机上运行的命令。 作为响应,PowerShell 请求 User01 帐户...
剩下的工作就交给Switch吧!下面的语句会获取所有安装的自动更新日志。使用它比之前使用的Get-Content和ForEach-Object更快速。你只需要记住正则表达式“.*”代表任意数量的任意字符。 Switch -regex -file $env:windir\wu1.log {'START.*Agent: Install.*AutomaticUpdates' { $_ }} 2013-05-19 09:22:04:113...