Aracılığıyla paylaş


Liste Görünümü (Temel)

Bu örnek, Get-Service cmdlet'i tarafından döndürülen System.ServiceProcess.ServiceController nesnelerini görüntüleyen temel bir liste görünümünün nasıl uygulandığını gösterir. Liste görünümünün bileşenleri hakkında daha fazla bilgi için bkz. Liste Görünümü Oluşturma.

Bu biçimlendirme dosyasını yükle

  1. Bu konunun Örnek bölümündeki XML'yi bir metin dosyasına kopyalayın.

  2. Metin dosyasını kaydedin. Biçimlendirme dosyası olarak tanımlamak için dosyaya format.ps1xml uzantısını eklediğinizden emin olun.

  3. Windows PowerShell'i açın ve biçimlendirme dosyasını geçerli oturuma yüklemek için aşağıdaki komutu çalıştırın: Update-FormatData -PrependPath PathToFormattingFile.

Uyarı

Bu biçimlendirme dosyası, Windows PowerShell biçimlendirme dosyası tarafından zaten tanımlanmış bir nesnenin görünümünü tanımlar. cmdlet'ini çalıştırırken PrependPath parametresini kullanmanız gerekir ve bu biçimlendirme dosyasını modül olarak yükleyemezsiniz.

Gösterir

Bu biçimlendirme dosyası aşağıdaki XML öğelerini gösterir:

Örnek

Aşağıdaki XML, System.ServiceProcess.ServiceController nesnesinin dört özelliğini görüntüleyen bir liste görünümünü tanımlar. Her satırda, özelliğin adı ve ardından özelliğin değeri görüntülenir.

<Configuration>
  <View>
    <Name>System.ServiceProcess.ServiceController</Name>
    <ViewSelectedBy>
      <TypeName>System.ServiceProcess.ServiceController</TypeName>
    </ViewSelectedBy>
    <ListControl>
      <ListEntries>
        <ListEntry>
          <ListItems>
            <ListItem>
              <PropertyName>Name</PropertyName>
            </ListItem>
            <ListItem>
              <PropertyName>DisplayName</PropertyName>
            </ListItem>
            <ListItem>
              <PropertyName>Status</PropertyName>
            </ListItem>
            <ListItem>
              <PropertyName>ServiceType</PropertyName>
            </ListItem>
          </ListItems>
        </ListEntry>
      </ListEntries>
    </ListControl>
  </View>
</Configuration>

Aşağıdaki örnekte, Windows PowerShell'in bu biçim dosyası yüklendikten sonra System.ServiceProcess.ServiceController nesnelerini nasıl görüntülediği gösterilmektedir.

Get-Service f*
Name        : Fax
DisplayName : Fax
Status      : Stopped
ServiceType : Win32OwnProcess

Name        : FCSAM
DisplayName : Microsoft Antimalware Service
Status      : Running
ServiceType : Win32OwnProcess

Name        : fdPHost
DisplayName : Function Discovery Provider Host
Status      : Stopped
ServiceType : Win32ShareProcess

Name        : FDResPub
DisplayName : Function Discovery Resource Publication
Status      : Running
ServiceType : Win32ShareProcess

Name        : FontCache
DisplayName : Windows Font Cache Service
Status      : Running
ServiceType : Win32ShareProcess

Name        : FontCache3.0.0.0
DisplayName : Windows Presentation Foundation Font Cache 3.0.0.0
Status      : Stopped
ServiceType : Win32OwnProcess

Name        : FSysAgent
DisplayName : Microsoft Forefront System Agent
Status      : Running
ServiceType : Win32OwnProcess

Name        : FwcAgent
DisplayName : Firewall Client Agent
Status      : Running
ServiceType : Win32OwnProcess

Ayrıca Bkz.

Biçimlendirme Dosyaları Örnekleri

PowerShell Biçimlendirme Dosyasını Yazma