How To: Save a script for an adaptable application or workflow
Symptom
Applies to:
All versions of TPP
Symptom:
You have deployed a new script for an adaptable object in TPP. When you save it, it returns an error that says The current PowerShell script is not yet allowed. Re-save the policy where the script is assigned to approve the script.
Cause:
The error can indicate one of two things:
- The script is saved in a nested folder with insufficient permissions to save the new script.
- You have the script saved across multiple TPP engines and there is at least one script that does not match the other scripts.
- See the following article as well: Info: Permission requirements for Adaptable Applications
In both cases, this error occurs because TPP will require approval of any script changes before the script can be saved. This is a safeguard to ensure all scripts are correct and non-malicious before being put into use.
Resolution:
If the folder containing the script is nested, start with the folder where the script is saved and attempt to save it there. If you save it and the object still shows the error, move to the next folder up and save again. Repeat this process until it saves without error.
If you save at every level and can still see an error, you may have mismatched scripts on your TPP engines. You can check for a mismatch using the Get-FileHash command in PowerShell.
NOTE: Venafi Support can help ensure the driver template, TPP Platform, and TPP API are working as designed but will not help write or troubleshoot your scripted solution.
More Info:
To find a mismatched script, take the following steps:
- On each TPP engine, find the folder that contains the script
- Open PowerShell in Admin on the TPP engine
- Run the command
Get-FileHashand the file path to the script - Make a note of the hash (you can take a screenshot or copy and paste it to a notepad)
- Repeat the process on each TPP engine
If you find one script with a hash that is separate from the rest, compare that script to the others and change it as needed.
If you find multiple scripts with a hash that is separate from the rest, compare all scripts, decide which script has the correct code, and make that the "master script".
In both cases, once you have a script you are satisfied with, copy and paste it into the other script locations on the other TPP engines. Confirm a request to overwrite the old copy of the script.
Environment
TPP/TLSPDC