因此,我使用 Stop-AzRecoveryServicesBackupJob powershell 命令遇到了错误请求错误。该文档没有帮助,因为它只需要 -JobID $Job.InstanceId 作为参数。但是,InstanceId 不存在。JobID 可以,但会返回错误的请求错误。
我的代码:错误请求在 Stop-AzRecoveryServicesBackupJob -JobID $BackupJob.JobId
#get RSV
$myVault = Get-AzRecoveryServicesVault -ResourceGroupName $myResourceGroup -Name $vaultName
#Disable soft delete on RSV
$myVault.ID | Set-AzRecoveryServicesVaultProperty -SoftDeleteFeatureState Disable | Out-Null
$BackupJob = $myVault.ID | Get-AzRecoveryServicesBackupJob -Operation Backup
Stop-AzRecoveryServicesBackupJob -JobID $BackupJob.JobId
错误消息:Stop-AzRecoveryServicesBackupJob:无法取消作业。只能取消正在进行的作业。请仅在进行中的作业上尝试取消。在 C:\Users\azureuser\Documents\WindowsPowerShell\temp.ps1:20 char:1
- 停止-AzRecoveryServicesBackupJob -Job $BackupJob
-
+ CategoryInfo : InvalidOperation: (:) [Stop-AzRecoveryServicesBackupJob], CloudException + FullyQualifiedErrorId : BMSUserErrorJobNotInProgressToCancel,Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.StopAzureRmRecoveryServicesBackupJo b