Directory test not sufficient if key is empty.
Certain programs like Anaconda or other Python installs that might have installed into the HKLM, if removed, my leave that path blank. Likewise, with HKCU. If either of these directory checks returns TRUE, but returns zero child objects, the script fails with
You cannot call a method on a null-valued expression.
At C:\Users\admin72014\Projects\oci\oci-cli\scripts\install\install.ps1:108 char:44
-
If ($installation.Name.EndsWith <<<< ("\InstallPath")) {
- CategoryInfo : InvalidOperation: (EndsWith:String) [], RuntimeException
- FullyQualifiedErrorId : InvokeMethodOnNull

Commenting out the empty key allows installation to proceed.