PSM - Error when executing PSMConfigureAppLocker.ps1 for the second time
129
Created On 11/10/26 10:55 AM - Last Modified 11/10/26 15:59 PM
Symptom
The following error occurs when executing PSMConfigureAppLocker.ps1
======================================
PS C:\Program Files (x86)\CyberArk\PSM\Hardening> .\PSMConfigureAppLocker.ps1
[Idira PSM AppLocker configuration script error]
Error message: The variable '$stepUnitStatusTracker' cannot be retrieved because it has not been set.
The variable '$PSMConfigureAppLockerScriptName' cannot be retrieved because it has not been set.
At C:\Program Files (x86)\CyberArk\PSM\Hardening\PSMConfigureAppLocker.ps1:71 char:18
+ Write-ErrorLog $PSMConfigureAppLockerScriptName ("Error messa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (PSMConfigureAppLockerScriptName:String) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined
======================================
This error occurs when PSMConfigureAppLocker.ps1 is executed twice with a short interval.
Environment
14.0;14.6 Privilege Cloud PSM
Resolution
To address this issue, you may execute a command designed to resolve permission restrictions on the file. Specifically, you can execute a command to unlock the files. Here is an example:
dir C:\Downloads -Recurse | Unblock-File.This command recursively lists the contents of the specified directory and unlocks the files to allow access, and thereby mitigating the permission-related error.
Closing PowerShell and starting it again also helps here.