Skip to content

Commit d2d91c5

Browse files
authored
Update site-recovery-runbook-automation.md
The Powershell code was missing an important part where you need to have a parameter to allow passing in the RecoveryPlanContext object. If this not present the next line 5 will fail with during the "Get-Member"
1 parent ed81b73 commit d2d91c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

articles/site-recovery/site-recovery-runbook-automation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ If you want to access all VMs in VMMap in a loop, you can use the following code
8181

8282

8383
```powershell
84+
param (
85+
[parameter(Mandatory=$false)]
86+
[Object]$RecoveryPlanContext
87+
)
8488
$VMinfo = $RecoveryPlanContext.VmMap | Get-Member | Where-Object MemberType -EQ NoteProperty | select -ExpandProperty Name
8589
$vmMap = $RecoveryPlanContext.VmMap
8690
foreach($VMID in $VMinfo)

0 commit comments

Comments
 (0)