PowerShell 개체의 모든 속성을 나열하는 방법
내가 볼 때 하여 Win32_ComputerSystem 클래스 ,이 같은 특성의 부하를 보여주고 Status
, PowerManagementCapabilities
등 그러나, PowerShell에서 내가 할 때 나는 단지 몇 돌아갈 아래 :
PS C:\Windows\System32\drivers> Get-WmiObject -Class "Win32_computersystem"
Domain : YYY.com
Manufacturer : VMware, Inc.
Model : VMware Virtual Platform
Name : LONINEGFQEF58
PrimaryOwnerName : Authorised User
TotalPhysicalMemory : 2147016704
모든 속성을 어떻게 볼 수 있습니까?
이 시도:
Get-WmiObject -Class "Win32_computersystem" | Format-List *
Get-WmiObject -Class "Win32_computersystem" | Format-List -Property *
특정 개체의 경우 PowerShell은 테이블 또는 목록 형식에 영향을 줄 수있는 형식 지정 지침 집합을 제공합니다. 이것은 일반적으로 속성의 표시를 필수 속성으로 제한하는 것을 의미합니다. 그러나 모든 것을 정말로보고 싶을 때가 있습니다. 이 경우 Format-List *
모든 속성이 표시됩니다. PowerShell 오류 레코드를 보려는 경우 "Format-List * -Force"를 사용하여 모든 오류 정보를 확인해야합니다 (예 :
$error[0] | Format-List * -force
와일드 카드는 다음과 같은 전통적인 윌 카드처럼 사용할 수 있습니다.
Get-WmiObject -Class "Win32_computersystem" | Format-List M*
어떤 속성 (및 메소드)이 있는지 알고 싶다면 :
Get-WmiObject -Class "Win32_computersystem" | Get-Member
다음을 사용할 수도 있습니다.
Get-WmiObject -Class "Win32_computersystem" | Select *
이것은 다른 답변에 사용 된 Format-List *와 동일한 결과를 표시합니다.
나는 좋아한다
Get-WmiObject Win32_computersystem | format-custom *
그것은 모든 것을 확장시키는 것 같습니다.
PowerShellCookbook 모듈에는 GUI에서이를 수행하는 show-object 명령도 있습니다. PowerShell 제작자 인 Jeffrey Snover는 플러그를 뽑은 비디오 (권장)에서이를 사용합니다.
가장 자주 사용하지만
Get-WmiObject Win32_computersystem | fl *
오브젝트 유형에 대한 테이블 또는 목록보기 (있는 경우)를 정의하는 .format.ps1xml 파일을 피합니다. 형식 파일은 속성 이름과 일치하지 않는 열 헤더를 정의 할 수도 있습니다.
가장 간결한 방법은 다음과 같습니다.
Get-WmiObject -Class win32_computersystem -Property *
참고 URL : https://stackoverflow.com/questions/7259142/how-to-list-all-properties-of-a-powershell-object
'Programming' 카테고리의 다른 글
자바를 사용하여 이메일 보내기 (0) | 2020.08.03 |
---|---|
텍스트 크기와 다른 안드로이드 화면 크기 (0) | 2020.08.03 |
Parallel.ForEach가 완료 될 때까지 어떻게 기다려야합니까? (0) | 2020.08.03 |
자동 레이아웃을 사용하여 UICollectionView에서 셀의 하나의 차원 지정 (0) | 2020.08.03 |
어플리케이션 서버와 서블릿 컨테이너의 차이점은 무엇입니까? (0) | 2020.08.03 |