Many users have requested to be able to run day to day powershell commandlets and scripts from a DOS batch file. For convenience, they requested that all code is embedded in the same batch file, thus easing portability and avoiding loosing or damaging dependent files. Moreover, such a tool would allow avoiding the slow response of the GUI when performing the same operations.
PowerShell Scripting Disclaimer:
This script is provided "as is" for the purpose of illustrating how product tasks may be performed in conjunction with PowerShell. Support shall not be liable for any direct, indirect, incidental, consequential, or other damage alleged in connection with the furnishing or use of this script or of the principles it demonstrates. See PowerShell Scripting Support for more information.
In order to address this request, the attached batch file has been created. It is attached to the case.The powershell code is embedded in an encoded form thus avoiding the need for separate script files.
Please note that enabling and disabling the CoreService has been performed through a regular CMD utility (sc.exe) versus Powershell for two reasons. First, it gives an explicit success message as opposed to the same powershell cmdlet and second it allows setting the core service to the required “Delay-Auto” startup mode which is not possible directly via PowerShell..
The .bat file needs to be run from an elevated dos command prompt on the core to be maintained and provides the following functionality:
NOTE: when suspending/resuming replication, the embedded powershell script detects all Master/Slave cores so no user input is necessary. As the base of powershell commands increases, more functionality will be added to the “Swiss Knife Tool”. This updated version adds an option to "Suspend or Resume Virtual Standby Exports" and has a better "Suspend or Resume Replication" routine. Powershell 3.0 or later and AppAssure 5.4.x are required.