Run pre-installation check script
The script checks all prerequisites for RPA installation. It is used to ensure the target machine is configured properly to run RPA, including registry keys, group policies, Windows features, and Windows Firewall rules. Apply the script before you proceed to the RPA server installation.
How to use it
note
You need Administrator permissions to run the script.
Run .\requirements_check.ps1 -help to get a detailed message that explains arguments and usage. requirements_check.ps1 verifies if RPA settings, RDS settings, and Windows Firewall rules are correctly configured. The script outputs a JSON array of objects containing details about verified entities. Use the LASTEXITCODE variable to see if the script succeeded.
Usage:
.\requirements_check.ps1 [-skipPortVerification] [-logLocation <<path>|stdout>]
The examples are as follows:
.\requirements_check.ps1 # simply run the tool, logs will not be printed unless a critical failure occurs
.\requirements_check.ps1 -skipPortVerification # skips verifying Windows Firewall rules
.\requirements_check.ps1 -logLocation log.txt # writes a debug log to the log.txt file
.\requirements_check.ps1 -logLocation stdout # writes a debug log to standard output, not usable when called by another process
Output
Exit codes are as follows:
0: success; the output is JSON.1: one or more requirements are not satisfied; the output is JSON.2: critical failure; the output is not JSON, cannot be parsed by automated tooling.
If $LASTEXITCODE is set to 0 or 1, the output is JSON that you can parse with some automated tool. The JSON array is composed of objects containing the information about checked entities and the final results.
If $LASTEXITCODE is 2, a critical failure happens. It usually means that logs are printed to standard output, and the output is not a valid JSON.
Example:
[
{
"type": "RegistryKey",
"name": "HKLM\\SomeKey/SomeValue",
"expectedValue": 0,
"actualValue": 0,
"success": true,
"failureReason": "",
"errorCode": 0
}
]
You can use some processing software to present the output in a more convenient way.
Example: get only failed requirements with PowerShell.
.\requirements_check.ps1 -skipPortVerification | ConvertFrom-Json) | where { -Not $_.success } | ConvertTo-Json
Error codes
The errorCode field is a numeric value of the failureReason field. The list of error codes is available directly in requirements_check.ps1:
$objectErrorCodes = @'
{
"Success": 0,
"KeyDoesNotExist": 1,
"ValueIsNotEqual": 2,
"ParentKeyDoesNotExist": 3,
"Exception": 4,
"FeatureNotInstalled": 5,
"RDSNotActivated": 6,
"RDSErrorUnknown": 7,
"SystemIsNotWindowsServer": 8,
"PortIsClosedOrUnspecified": 9
}
'@ | ConvertFrom-Json # Error code list, used by objectTemplate.errorCode
Logs
The script also supports writing logs that you can use for debugging if anything goes wrong.
To print logs to standard output, do as follows:
.\requirements_check.ps1 -logLocation stdout
As a result of the action, you can no longer parse the output with the help of other tools.
Also, you can redirect logs to a file:
.\requirements_check.ps1 -logLocation file.txt