Get-Container
Get-Container
Gets information about containers.
Syntax
Parameter Set: Id
Get-Container [[-Id] <Guid> ] [-CimSession <CimSession[]> ] [-ComputerName <String[]> ] [-Credential <PSCredential[]> ] [ <CommonParameters>]
Parameter Set: Name
Get-Container [[-Name] <String[]> ] [-CimSession <CimSession[]> ] [-ComputerName <String[]> ] [-Credential <PSCredential[]> ] [ <CommonParameters>]
Detaillierte Beschreibung
The Get-Container cmdlet gets information about containers.
Parameter
-CimSession<CimSession[]>
Das Cmdlet wird in einer Remotesitzung oder auf einem Remotecomputer ausgeführt. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, wie z. B. die Ausgabe eines New-CimSession oder Get-CimSession-Cmdlets. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-ComputerName<String[]>
Specifies one or more Hyper-V hosts to run the cmdlet. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer. Use "localhost" or a dot (".") to specify the local computer explicitly.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Credential<PSCredential[]>
Specifies a user account that has permission to perform this action. The default is the current user.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Id<Guid>
Specifies the ID of the container that this cmdlet retrieves.
Aliase |
none |
Erforderlich? |
false |
Position? |
1 |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
true(ByValue,ByPropertyName) |
Platzhalterzeichen akzeptieren? |
false |
-Name<String[]>
Specifies the name of the container that this cmdlet retrieves.
Aliase |
none |
Erforderlich? |
false |
Position? |
1 |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
true(ByValue) |
Platzhalterzeichen akzeptieren? |
false |
<CommonParameters>
Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Eingaben
Der Eingabetyp ist der Typ der Objekte, die Sie per Piping an das Cmdlet übergeben können.
Ausgaben
Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.
Microsoft.Containers.PowerShell.Objects.Container
Microsoft.Containers.PowerShell.Objects.Container
Beispiele
Example 1: Get information about containers on the local host
This command gets information about all containers on the local host.
PS C:\> Get-Container
Example 2: Get information about containers running on a server
This command gets all containers on the host named Server01 that are running.
PS C:\> Get-Container -ComputerName "Server01" | Where-Object {$_.State -eq 'Running'}