Get-AzBatchNodeFileContent
Hiermee haalt u een Batch-knooppuntbestand op.
Syntaxis
Get-AzBatchNodeFileContent
-JobId <String>
-TaskId <String>
[-Path] <String>
-DestinationPath <String>
[-ByteRangeStart <Int64>]
[-ByteRangeEnd <Int64>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchNodeFileContent
-JobId <String>
-TaskId <String>
[-Path] <String>
-DestinationStream <Stream>
[-ByteRangeStart <Int64>]
[-ByteRangeEnd <Int64>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchNodeFileContent
[-PoolId] <String>
[-ComputeNodeId] <String>
[-Path] <String>
-DestinationPath <String>
[-ByteRangeStart <Int64>]
[-ByteRangeEnd <Int64>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchNodeFileContent
[-PoolId] <String>
[-ComputeNodeId] <String>
[-Path] <String>
-DestinationStream <Stream>
[-ByteRangeStart <Int64>]
[-ByteRangeEnd <Int64>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchNodeFileContent
[[-InputObject] <PSNodeFile>]
-DestinationPath <String>
[-ByteRangeStart <Int64>]
[-ByteRangeEnd <Int64>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchNodeFileContent
[[-InputObject] <PSNodeFile>]
-DestinationStream <Stream>
[-ByteRangeStart <Int64>]
[-ByteRangeEnd <Int64>]
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
De Get-AzBatchNodeFileContent cmdlet haalt een Azure Batch-knooppuntbestand op en slaat het op als een bestand of in een stream.
Voorbeelden
Voorbeeld 1: Een Batch-knooppuntbestand ophalen dat is gekoppeld aan een taak en het bestand opslaan
Get-AzBatchNodeFileContent -JobId "Job01" -TaskId "Task01" -Path "StdOut.txt" -DestinationPath "E:\PowerShell\StdOut.txt" -BatchContext $Context
Met deze opdracht wordt het knooppuntbestand met de naam StdOut.txtopgehaald en opgeslagen in het E:\PowerShell\StdOut.txt bestandspad op de lokale computer. Het knooppuntbestand StdOut.txt is gekoppeld aan de taak met de id-taak01 voor de taak met de id-taak01. Gebruik de cmdlet Get-AzBatchAccountKey om een context toe te wijzen aan de $Context variabele.
Voorbeeld 2: Een Batch-knooppuntbestand ophalen en opslaan in een opgegeven bestandspad met behulp van de pijplijn
Get-AzBatchNodeFile -JobId "Job02" -TaskId "Task02" -Path "StdErr.txt" -BatchContext $Context | Get-AzBatchNodeFileContent -DestinationPath "E:\PowerShell\StdOut.txt" -BatchContext $Context
Met deze opdracht wordt het knooppuntbestand met de naam StdErr.txt opgehaald met behulp van de Get-AzBatchNodeFile-cmdlet. De opdracht geeft dat bestand door aan de huidige cmdlet met behulp van de pijplijnoperator. Met de huidige cmdlet wordt dat bestand opgeslagen in het E:\PowerShell\StdOut.txt bestandspad op de lokale computer. Het knooppuntbestand StdOut.txt is gekoppeld aan de taak met de id-taak02 voor de taak met de id-taak02.
Voorbeeld 3: Een Batch-knooppuntbestand ophalen dat is gekoppeld aan een taak en dit doorsturen naar een stream
$Stream = New-Object -TypeName "System.IO.MemoryStream"
Get-AzBatchNodeFileContent -JobId "Job03" -TaskId "Task11" -Path "StdOut.txt" -DestinationStream $Stream -BatchContext $Context
Met de eerste opdracht maakt u een stream met behulp van de New-Object-cmdlet en slaat u deze vervolgens op in de $Stream variabele. Met de tweede opdracht wordt het knooppuntbestand opgehaald met de naam StdOut.txt van de taak met de id-taak11 voor de taak met de id-taak03. De opdracht stuurt de bestandsinhoud naar de stream in $Stream.
Voorbeeld 4: Een knooppuntbestand ophalen uit een rekenknooppunt en opslaan
Get-AzBatchNodeFileContent -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "Startup\StdOut.txt" -DestinationPath "E:\PowerShell\StdOut.txt" -BatchContext $Context
Met deze opdracht wordt het knooppuntbestand\StdOut.txt opgehaald uit het rekenknooppunt met de id ComputeNode01 in de pool met de id-pool01. Met de opdracht wordt het bestand opgeslagen in het E:\PowerShell\StdOut.txt bestandspad op de lokale computer.
Voorbeeld 5: Een knooppuntbestand ophalen uit een rekenknooppunt en opslaan met behulp van de pijplijn
Get-AzBatchNodeFile -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "Startup\StdOut.txt" -BatchContext $Context | Get-AzBatchNodeFileContent -DestinationPath "E:\PowerShell\StdOut.txt" -BatchContext $Context
Met deze opdracht wordt het opstartbestand van het knooppunt\StdOut.txt opgehaald met behulp van Get-AzBatchNodeFile van het rekenknooppunt met de id ComputeNode01. Het rekenknooppunt bevindt zich in de pool met de id-pool01. De opdracht geeft dat knooppuntbestand door aan de huidige cmdlet. Met deze cmdlet wordt het bestand opgeslagen in het E:\PowerShell\StdOut.txt bestandspad op de lokale computer.
Voorbeeld 6: Een knooppuntbestand ophalen van een rekenknooppunt en dit naar een stream leiden
$Stream = New-Object -TypeName "System.IO.MemoryStream"
Get-AzBatchNodeFileContent -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "startup\stdout.txt" -DestinationStream $Stream -BatchContext $Context
Met de eerste opdracht maakt u een stream met behulp van de New-Object-cmdlet en slaat u deze vervolgens op in de $Stream variabele. Met de tweede opdracht wordt het knooppuntbestand opgehaald met de naam StdOut.txt van het rekenknooppunt met de id ComputeNode01 in de pool met de id-pool01. De opdracht stuurt de bestandsinhoud naar de stream in $Stream.
Parameters
-BatchContext
Hiermee geeft u het BatchAccountContext exemplaar dat door deze cmdlet wordt gebruikt om te communiceren met de Batch-service. Als u de cmdlet Get-AzBatchAccount gebruikt om uw BatchAccountContext op te halen, wordt Microsoft Entra-verificatie gebruikt bij interactie met de Batch-service. Als u in plaats daarvan verificatie met gedeelde sleutels wilt gebruiken, gebruikt u de cmdlet Get-AzBatchAccountKey om een BatchAccountContext-object op te halen waarin de bijbehorende toegangssleutels zijn ingevuld. Wanneer u verificatie met gedeelde sleutels gebruikt, wordt de primaire toegangssleutel standaard gebruikt. Als u de sleutel wilt wijzigen die u wilt gebruiken, stelt u de eigenschap BatchAccountContext.KeyInUse in.
Type: | BatchAccountContext |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ByteRangeEnd
Het einde van het bytebereik dat moet worden gedownload.
Type: | Nullable<T>[Int64] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ByteRangeStart
Het begin van het bytebereik dat moet worden gedownload.
Type: | Nullable<T>[Int64] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ComputeNodeId
Hiermee geeft u de id op van het rekenknooppunt dat het knooppuntbestand bevat dat door deze cmdlet wordt geretourneerd.
Type: | String |
Position: | 1 |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-DefaultProfile
De referenties, het account, de tenant en het abonnement die worden gebruikt voor communicatie met Azure.
Type: | IAzureContextContainer |
Aliassen: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-DestinationPath
Hiermee geeft u het bestandspad op waar deze cmdlet het knooppuntbestand opslaat.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-DestinationStream
Hiermee geeft u de stroom op waarin deze cmdlet de inhoud van het knooppuntbestand schrijft. Met deze cmdlet wordt deze stream niet gesloten of terugspoelen.
Type: | Stream |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-InputObject
Hiermee geeft u het bestand op dat door deze cmdlet wordt opgehaald, als een PSNodeFile--object. Gebruik de cmdlet Get-AzBatchNodeFile om een knooppuntbestandsobject op te halen.
Type: | PSNodeFile |
Position: | 0 |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-JobId
Hiermee geeft u de id op van de taak die de doeltaak bevat.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-Path
Het pad van het knooppuntbestand dat moet worden gedownload.
Type: | String |
Aliassen: | Name |
Position: | 2 |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-PoolId
Hiermee geeft u de id op van de pool die het rekenknooppunt bevat dat het knooppuntbestand bevat dat door deze cmdlet wordt opgehaald.
Type: | String |
Position: | 0 |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-TaskId
Hiermee geeft u de id van de taak.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
Invoerwaarden
Uitvoerwaarden
Verwante koppelingen
Azure PowerShell