about_Properties 项目 2024/05/09 1 个参与者 本文内容 简短说明 长说明 属性值 成员访问枚举 另请参阅 简短说明 介绍如何在 PowerShell 中使用对象属性。 长说明 PowerShell 使用称为 对象的结构化信息集合来表示数据存储中的项或计算机的状态。 通常,可以使用属于 Microsoft .NET Framework的对象,但也可以在 ...
{"ModuleLogging": {"EnableModuleLogging":true,"ModuleNames": ["PSReadLine","PowerShellGet"] } } ProtectedEventLogging 此设置允许配置受保护的事件日志记录。 设置包含两个子项: EnableProtectedEventLogging- 如果启用此策略设置,则支持该策略的组件会在将日志数据写入日志数据之前使用你提供的证书来加密...
In the following example, use Can* as one of the values for the Property parameter to return all the properties that start with Can. These include CanPauseAndContinue, CanShutdown, and CanStop. PowerShell Copy Get-Service -Name w32time | Select-Object -Property Status, DisplayName, Can*...
默认情况下,所有模块的LogPipelineExecutionDetails属性设置为$False。 若要为模块启用模块日志记录,请使用以下命令格式。 模块必须导入到会话中,并且设置仅在当前会话中有效。 PowerShell复制 Import-Module<Module-Name> (Get-Module<Module-Name>).LogPipelineExecutionDetails =$true 若要为特定计算机上的所有会话...
有关详细信息,请参阅 about_Calculated_Properties。 展开表 类型: Object[] Position: 0 默认值: None 必需: False 接受管道输入: False 接受通配符: False输入PSObject 可以通过管道将任何对象传递给此 cmdlet。输出GroupInfo 默认情况下,此 cmdlet 返回 GroupInfo 对象。Hash...
"aa","Aa","Bb","bb"|Select-Object-Unique-CaseInsensitiveaa Bb 示例7:在事件日志中选择最新和最早的事件 此示例获取 Windows PowerShell 事件日志中的第一个(最新)和最后一个(最早)事件。 Get-WinEvent获取 Windows PowerShell 日志中的所有事件,并将其保存在$a变量中。 然后,通过管道将$a传递给Select-...
The properties of the class correspond to the parameters available when using the cmdlet.The noun portion of the cmdlet name allows you to differentiate your custom cmdlet from other cmdlets. The noun part specifies the resources upon which the cmdlet acts. Ideally, the noun used in cmdlet ...
Example 3: Get multiple property values of a file or folder This command gets the values of theLastWriteTime,CreationTime, andRootproperties of a folder. The property values are returned in the order in which you specified the property names. ...
(Get-Item .\testfile.txt).psobject.Properties | ?{$_.TypeNameOfValue -eq 'System.DateTime'} | Select Name,Value The PowerShell command gathers the time and date properties attached to a file. There are good reasons to use any one of these values, but this example will focus on the...
Percent signs in the invocation message represent structured ETW properties. While they are replaced with the actual values in the message text, a more robust way to access them is to retrieve the message with the Get-WinEvent cmdlet, and then use the Properties array of the message. Here’...