This should work
PowerShell script that runs locally on windows SRM server version fails to run after photon OS version of SRM as it does not have access to the SRM Runtime environment variable. SRM is now external .
SRM Runtime variable : https://docs.vmware.com/en/Site-Recovery-Manager/8.5/com.vmware.srm.admin.doc/GUID-2D288B46-27D1-41E...
No need to change the entire PowerShell script, just a small piece of code injected on SRM appliance should work.
Step1 : Search your PowerShell script for anything starting with $ENV. . It is a environment variable for example $ENV.VMware_RecoveryName, $ENV.VMware_RecoveryMode, $ENV.VMware_VC_Host, $ENV.VMware_VC_Port.
Step2 : SSH into the SRM appliance as 'admin' . upload the getEnv.py on /admin/home directory . If you want to use any other user please select the appropriate permission and location.
Step3: go back to PowerShell script, you will need plink.exe to SSH (download from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
Step4: To get the environment variable into your PowerShell script
$command = "python getEnv.py " + {prev SRM variable name}
$windows_var= Write-Output 'y' | & $PLINKPATH -pw $SRMpassword $sRM_USERNAME@$SRM_hostname $command
example : $command = "python getEnv.py " + "VMware_RecoveryName"
getEnv,py returns the SRM runtime variable value in Uppercase or return 'NONE' . Have a if condition to check the value is not 'NONE'