Enabling PowerShell Functions with SRM - DR of the Cloud

Enabling PowerShell Functions with SRM - DR of the Cloud

When calling PowerShell functions as part of a Site Recovery Manager (SRM) v5.1 recovery plan, you need to perform some additional configurations within PowerShell.

This can be achieved using the following procedures.

Step 1 - Set the execution level

  1. Launch the 32-bit version of PowerShell.
  2. Set the execution policy to RemoteSigned.
1Set-ExecutionPolicy RemoteSigned

Step 2 - Create and configure a PowerShell profile

  1. Verify if a profile already exists for the user. (assuming that one does not exist go to step 2)
1Test-Path $profile
  1. Force the creation of a new profile file.
1New-Item $profile -type file -force
  1. Open the new file in a Notepad session.
1Notepad $profile
  1. Enter the following syntax into the file, then save and close:
1Import-Module vCloudDR
2Add-PSSnapin -name VMware.VimAutomation.Core

Next time you start a new PowerShell session, it will load in our custom functions from the vCloudDR module and add in the VMware core cmdlets.

Step 3 - Install the custom modules for PowerShell to call

  1. Locate the folder path 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules'
  2. Create a new folder called 'vCloudDR'.

NOTE

This folder name must match the name used for the Import-Module command used in the profile in Step 2.


  1. Copy your custom module file into the newly created folder
  2. To test that the module has been loaded correctly, restart PowerShell and verify your custom module is listed by running the following command:
1Get-Module -ListAvailable

Posts in this Series