Windows batch file (extension
.bat
):
"& '
script-file-path-on-the-guest-OS-(vmware.scriptFileOnGuest-property)
'
'
script-argument-(vmware.scriptParameter-property)
' ; exit $LASTEXITCODE"
Windows PowerShell script (extension
.ps1
):
"Set-ExecutionPolicy RemoteSigned -Scope Process ; & '
script-file-path-on-
the-guest-OS-(vmware.scriptFileOnGuest-property)
' '
script-argument-
(vmware.scriptParameter-property)
' ; exit $LASTEXITCODE"
Shell script (extension
.sh
):
"/bin/bash '
script-file-path-on-the-guest-OS-(vmware.scriptFileOnGuest-
property)
' '
script-argument-(vmware.scriptParameter-property)
' "
The standard output and standard error output of each script run on the virtual server is stored in the
file on the target server that is specified as the output file path (vmware.scriptOutputFilePath property)
of the script.
3.
If yes is specified for whether to delete the script (vmware.deleteScriptEnabled property), the script
transmitted from the target server to the guest OS on the virtual server can be deleted. To delete the
script, use the following code applicable to the virtual server environment.
Windows-based OS:
"Remove-Item -LiteralPath '
script-file-path-on-the-guest-OS-
(vmware.scriptFileOnGuest-property)
' -Force "
UNIX OS:
"/bin/rm -f '
script-file-path-on-the-guest-OS-(vmware.scriptFileOnGuest-
property)
' "
Server requirements
The following servers are needed:
• vCenter server
Server where VMware vCenter Server is installed.
• ESX server
Server where VMware vSphere ESXi is installed.
• vCenter control server (execution target server)
Server where VMware vSphere PowerCLI is installed. Plug-ins are transferred to this server and run
by this product.
• Virtual server
Virtual server that is managed by the vCenter server and VMware vSphere ESX.
Prerequisites
• VMware vSphere ESXi must be managed by VMware vCenter Server.
• Conditions related to the settings on VMware vCenter Server:
Additional service templates
271