Get-AzRecoveryServicesBackupRPMountScript
下載腳本以掛接恢復點的所有檔案。
語法
Get-AzRecoveryServicesBackupRPMountScript
[-RecoveryPoint] <RecoveryPointBase>
[[-Path] <String>]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Get-AzRecoveryServicesBackupRPMountScript Cmdlet 會下載腳本,此腳本會在執行所在的電腦上掛接恢復點的磁碟區。
範例
範例 1:掛接恢復點
$namedContainer = Get-AzRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -FriendlyName "V2VM"
$backupitem = Get-AzRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM"
$startDate = (Get-Date).AddDays(-7)
$endDate = Get-Date
$rp = Get-AzRecoveryServicesBackupRecoveryPoint -Item $backupitem -StartDate $startdate.ToUniversalTime() -EndDate $enddate.ToUniversalTime()
<# To mount files of the latest recovery point, obtain the script by #>
Get-AzRecoveryServicesBackupRPMountScript -RecoveryPoint $rp[0]
OsType Password Filename
------ -------- --------
Windows e3632984e51f496 V2VM_wus2_8287309959960546283_451516692429_cbd6061f7fc543c489f1974d33659fed07a6e0c2e08740.exe
執行腳本時,它會掛接恢復點的檔案$rp[0]
範例 2
下載腳本以掛接恢復點的所有檔案。 ( 自動產生 )
Get-AzRecoveryServicesBackupRPMountScript -RecoveryPoint $rp[0] -VaultId $vault.ID
參數
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | False |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Path
檔案復原時應下載檔案的位置。 如果未提供 -Path,腳本檔案將會下載到目前目錄中。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-RecoveryPoint
要還原的恢復點物件
類型: | RecoveryPointBase |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-VaultId
復原服務保存庫的 ARM 識別碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | False |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |