Windows discovery classifier ends up with "The term 'executeWindowsClassify' is not recognized as the name of a cmdlet"


Description

Windows discovery classifier ends up with "The term 'executeWindowsClassify' is not recognized as the name of a cmdlet" after upgrading to Paris.

Paris has new version of script on the instance, but the record has the same timestamp as the old one. Synchronisation to the MID Server for this file works based on the timestamp so the MID ends up with the old script.

Steps to Reproduce

1. Login an Orlando instance, Patch 6 or later patch.
2. Discovery a WMI Windows device.
3. Upgrade to Paris Patch 1 or Patch 2.
4. Run the same Discovery as in step 2. See the following message in the Windows Classify:
The term 'executeWindowsClassify' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.HRESULT: [-2146233087]

Workaround

The main reason for the issue is that the file PSScript.ps1 was not synced to MID.

1. Revert to OOB any changes made to the MID server script files on the instance:
a. Go to MID Server > MID Server Script Files > Open "PSScript.ps1"
b. Scroll down to Versions and revert it to base system

2. Export the PSScript.ps1 record as XML

3. Delete the PSScript.ps1 file (This will force sync MID servers to delete the file, this can be validated by checking the ecc_queue for a "FileChange" SystemCommand)

4. Import the PSScript.ps1 XML(This force syncs the MIDs to re-create the file with the correct code, similar to step 3)

This problem is fixed in the next upcoming release. If you are able to upgrade, review the Fixed In section to determine the latest version with a permanent fix your instance can be upgraded to.


Related Problem: PRB1442194