你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzBatchRemoteDesktopProtocolFile
从计算节点获取 RDP 文件。
语法
Get-AzBatchRemoteDesktopProtocolFile
[-PoolId] <String>
[-ComputeNodeId] <String>
-DestinationPath <String>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchRemoteDesktopProtocolFile
[-PoolId] <String>
[-ComputeNodeId] <String>
-DestinationStream <Stream>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchRemoteDesktopProtocolFile
[[-ComputeNode] <PSComputeNode>]
-DestinationPath <String>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchRemoteDesktopProtocolFile
[[-ComputeNode] <PSComputeNode>]
-DestinationStream <Stream>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzBatchRemoteDesktopProtocolFile cmdlet 从计算节点获取远程桌面协议 (RDP) 文件,并将其保存为文件或用户提供的流。
示例
示例 1:从指定的计算节点获取 RDP 文件并保存文件
Get-AzBatchRemoteDesktopProtocolFile -PoolId "Pool06" -ComputeNodeId "ComputeNode01" -DestinationPath "C:\PowerShell\ComputeNode01.rdp" -BatchContext $Context
此命令从具有 ID Pool06 的池中 ID ComputeNode01 的计算节点获取 RDP 文件。 该命令将 .rdp 文件保存为 C:\PowerShell\MyComputeNode.rdp。 使用 Get-AzBatchAccountKey cmdlet 将上下文分配给$Context变量。
示例 2:从计算节点获取 RDP 文件,并使用管道保存文件
Get-AzBatchComputeNode -PoolId "Pool06" -Id "ComputeNode02" -BatchContext $Context | Get-AzBatchRemoteDesktopProtocolFile -DestinationPath "C:\PowerShell\MyComputeNode02.rdp" -BatchContext $Context
此命令获取在 ID Pool06 的池中具有 ID ComputeNode02 的计算节点。 该命令使用管道运算符将该计算节点传递到当前 cmdlet。 当前 cmdlet 从计算节点获取 .rpd 文件,然后将内容保存为名为 C:\PowerShell\MyComputeNode02.rdp 的文件。
示例 3:从指定的计算节点获取 RDP 文件并将其定向到流
$Stream = New-Object -TypeName "System.IO.MemoryStream"
Get-AzBatchRemoteDesktopProtocolFile "Pool06" -ComputeNodeId "ComputeNode03" -DestinationStream $Stream -BatchContext $Context
第一个命令使用 New-Object cmdlet 创建流,然后将其存储在$Stream变量中。 第二个命令从具有 ID Pool06 的池中 ID ComputeNode03 的计算节点获取 .rdp 文件。 该命令将文件内容定向到$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 |
-ComputeNode
将计算节点指定为 .rdp 文件指向的 PSComputeNode 对象。 若要获取计算节点对象,请使用 Get-AzBatchComputeNode cmdlet。
Type: | PSComputeNode |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ComputeNodeId
指定 .rdp 文件指向的计算节点的 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 保存 .rdp 文件的文件路径。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DestinationStream
指定此 cmdlet 将 RDP 数据定向到其中的流。 此 cmdlet 不会关闭或倒退此流。
Type: | Stream |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PoolId
指定包含此 cmdlet 从中获取 .rdp 文件的计算节点的池的 ID。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
输入
输出
相关链接
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈