Get-AzBatchNodeFileContent

Batch 노드 파일을 가져옵니다.

Syntax

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

Get-AzBatchNodeFileContent cmdlet은 Azure Batch 노드 파일을 가져와서 파일 또는 스트림으로 저장합니다.

예제

예제 1: 작업과 연결된 Batch 노드 파일 가져오기 및 파일 저장

Get-AzBatchNodeFileContent -JobId "Job01" -TaskId "Task01" -Path "StdOut.txt" -DestinationPath "E:\PowerShell\StdOut.txt" -BatchContext $Context

이 명령은 StdOut.txt 이름이 지정된 노드 파일을 가져오고 로컬 컴퓨터의 E:\PowerShell\StdOut.txt 파일 경로에 저장합니다. StdOut.txt 노드 파일은 ID Job01이 있는 작업에 대한 ID Task01이 있는 작업과 연결됩니다. Get-AzBatchAccountKey cmdlet을 사용하여 $Context 변수에 컨텍스트를 할당합니다.

예제 2: Batch 노드 파일을 가져와 파이프라인을 사용하여 지정된 파일 경로에 저장

Get-AzBatchNodeFile -JobId "Job02" -TaskId "Task02" -Path "StdErr.txt" -BatchContext $Context | Get-AzBatchNodeFileContent -DestinationPath "E:\PowerShell\StdOut.txt" -BatchContext $Context

이 명령은 Get-AzBatchNodeFile cmdlet을 사용하여 StdErr.txt 이름이 지정된 노드 파일을 가져옵니다. 이 명령은 파이프라인 연산자를 사용하여 해당 파일을 현재 cmdlet에 전달합니다. 현재 cmdlet은 로컬 컴퓨터의 E:\PowerShell\StdOut.txt 파일 경로에 해당 파일을 저장합니다. StdOut.txt 노드 파일은 ID Job02가 있는 작업에 대한 ID Task02가 있는 작업과 연결됩니다.

예제 3: 태스크와 연결된 Batch 노드 파일을 가져와서 스트림으로 전달

$Stream = New-Object -TypeName "System.IO.MemoryStream"
Get-AzBatchNodeFileContent -JobId "Job03" -TaskId "Task11" -Path "StdOut.txt" -DestinationStream $Stream -BatchContext $Context

첫 번째 명령은 New-Object cmdlet을 사용하여 스트림을 만든 다음 $Stream 변수에 저장합니다. 두 번째 명령은 ID Job03이 있는 작업에 대한 ID Task11이 있는 작업에서 StdOut.txt 이름이 지정된 노드 파일을 가져옵니다. 이 명령은 파일 내용을 $Stream 스트림으로 전달합니다.

예제 4: 컴퓨팅 노드에서 노드 파일 가져오기 및 저장

Get-AzBatchNodeFileContent -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "Startup\StdOut.txt" -DestinationPath "E:\PowerShell\StdOut.txt" -BatchContext $Context

이 명령은 ID Pool01이 있는 풀에 ID ComputeNode01이 있는 컴퓨팅 노드에서 노드 파일 Startup\StdOut.txt 가져옵니다. 이 명령은 로컬 컴퓨터의 E:\PowerShell\StdOut.txt 파일 경로에 파일을 저장합니다.

예제 5: 컴퓨팅 노드에서 노드 파일을 가져와 파이프라인을 사용하여 저장

Get-AzBatchNodeFile -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "Startup\StdOut.txt" -BatchContext $Context | Get-AzBatchNodeFileContent -DestinationPath "E:\PowerShell\StdOut.txt" -BatchContext $Context

이 명령은 ID ComputeNode01이 있는 컴퓨팅 노드에서 Get-AzBatchNodeFile을 사용하여 노드 파일 Startup\StdOut.txt 가져옵니다. 컴퓨팅 노드는 ID Pool01이 있는 풀에 있습니다. 이 명령은 해당 노드 파일을 현재 cmdlet에 전달합니다. 이 cmdlet은 로컬 컴퓨터의 E:\PowerShell\StdOut.txt 파일 경로에 파일을 저장합니다.

예제 6: 컴퓨팅 노드에서 노드 파일을 가져와서 스트림으로 전달

$Stream = New-Object -TypeName "System.IO.MemoryStream"
Get-AzBatchNodeFileContent -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "startup\stdout.txt" -DestinationStream $Stream -BatchContext $Context

첫 번째 명령은 New-Object cmdlet을 사용하여 스트림을 만든 다음 $Stream 변수에 저장합니다. 두 번째 명령은 ID Pool01이 있는 풀에 ID ComputeNode01이 있는 컴퓨팅 노드에서 StdOut.txt 이름이 지정된 노드 파일을 가져옵니다. 이 명령은 파일 내용을 $Stream 스트림으로 전달합니다.

매개 변수

-BatchContext

이 cmdlet이 Batch 서비스와 상호 작용하는 데 사용하는 BatchAccountContext 인스턴스를 지정합니다. Get-AzBatchAccount cmdlet을 사용하여 BatchAccountContext를 가져오는 경우 Batch 서비스와 상호 작용할 때 Microsoft Entra 인증이 사용됩니다. 대신 공유 키 인증을 사용하려면 Get-AzBatchAccountKey cmdlet을 사용하여 액세스 키가 채워진 BatchAccountContext 개체를 가져옵니다. 공유 키 인증을 사용하는 경우 기본 액세스 키가 기본적으로 사용됩니다. 사용할 키를 변경하려면 BatchAccountContext.KeyInUse 속성을 설정합니다.

Type:BatchAccountContext
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ByteRangeEnd

다운로드할 바이트 범위의 끝입니다.

Type:Nullable<T>[Int64]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ByteRangeStart

다운로드할 바이트 범위의 시작입니다.

Type:Nullable<T>[Int64]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ComputeNodeId

이 cmdlet이 반환하는 노드 파일을 포함하는 컴퓨팅 노드의 ID를 지정합니다.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

Azure와의 통신에 사용되는 자격 증명, 계정, 테넌트 및 구독입니다.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DestinationPath

이 cmdlet이 노드 파일을 저장하는 파일 경로를 지정합니다.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DestinationStream

이 cmdlet이 노드 파일 콘텐츠를 쓰는 스트림을 지정합니다. 이 cmdlet은 이 스트림을 닫거나 되감지 않습니다.

Type:Stream
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

이 cmdlet이 가져오는 파일을 PSNodeFile 개체로 지정합니다. 노드 파일 개체를 가져오려면 Get-AzBatchNodeFile cmdlet을 사용합니다.

Type:PSNodeFile
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-JobId

대상 작업이 포함된 작업의 ID를 지정합니다.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Path

다운로드할 노드 파일의 경로입니다.

Type:String
Aliases:Name
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PoolId

이 cmdlet이 가져오는 노드 파일을 포함하는 컴퓨팅 노드를 포함하는 풀의 ID를 지정합니다.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TaskId

작업의 ID를 지정합니다.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

입력

String

PSNodeFile

BatchAccountContext

출력

Void