最简单的方法是获取与某个项相关联的属性名称。 例如,若要查看注册表项HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion中的条目名称,请使用Get-Item。 注册表项有一个通用名称为“Property”的属性,它是项中的注册表条目列表。 以下命令选择 Property 属性并扩展这些项,以便它们可在列表中显示: ...
PS> Get-WmiObject -Class Win32_OperatingSystem | Get-Member -MemberType Property Name MemberType Definition --- --- --- BootDevice Property string BootDevice {get;set;} BuildNumber Property string BuildNumber {get;set;} BuildType Property string BuildType {get;set;} Caption Property string Ca...
Get-Service-Namew32time |Select-Object-PropertyStatus, DisplayName, Can* 請注意,列出的屬性會比預設顯示更多。 Output Status : Running DisplayName : Windows Time CanPauseAndContinue : False CanShutdown : True CanStop : True 方法 方法是您可以在 物件上執行的動作。 使用MemberType參數來縮小Get-Membe...
Get-ChildItem$PSHOME\pwsh.exe |Get-Member 命令的输出会列出 FileInfo 对象的成员。成员包括属性和方法。 在 PowerShell 中操作时,可以访问对象的所有成员。 如果只要获取对象的属性而不获取方法,请使用值为的Get-Membercmdlet 的 MemberType 参数,如以下示例所示。Property ...
Get-Service-Namew32time |Select-Object-Property* Output Name : w32time RequiredServices : {} CanPauseAndContinue : False CanShutdown : True CanStop : True DisplayName : Windows Time DependentServices : {} MachineName : . ServiceName : w32time ServicesDependedOn : {} ServiceHandle : Status ...
Note: The NumBindings property includes the primary mailbox, the main archive, and any additional archives for users included in the search. NumBindings is not the number of users included in the search, because each included user could have or not have a combination of a primary mailbox, ...
同样,CurrentUICulture属性返回Get-UICulture返回的对象。 主机对象的CurrentCulture属性包含System.Globalization.CultureInfo对象。 此命令使用管道运算符(|)将CultureInfo对象发送到Format-Listcmdlet。Format-List命令使用Property参数和值全部(*)来显示CultureInfo对象的所有属性和属性值。
Get-WinEvent-ListLogSetup |Format-List-Property* FileSize :69632IsLogFull : False LastAccessTime :3/13/201909:41:46LastWriteTime :3/13/201909:41:46OldestRecordNumber :1RecordCount :23LogName : Setup LogType : Operational LogIsolation : Application IsEnabled : True IsClassicLog : False Security...
TypeName: System.Diagnostics.Process Name MemberType Definition --- --- --- Handles AliasProperty Handles = Handlecount Name AliasProperty Name = ProcessName NPM AliasProperty NPM = NonpagedSystemMemorySize ... 备注 Get-Member 消除重复项,因此,如果对象都属于同一类型,则它只显示一种对象类型。 但...
Add completion of modules by their shortname (#20330) (Thanks @MartinGC94!) Fix Get-ItemProperty to report non-terminating error for cast exception (#21115) (Thanks @ArmaanMcleod!) Add -PropertyType argument completer for New-ItemProperty (#21117) (Thanks @ArmaanMcleod!) Fix a bug in how...