dnewsholme/PasswordState-Management

Get-PasswordStatePassword error when installed under user path

dsolodow opened this issue · 4 comments

The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
At C:\Users\dsolodow\OneDrive - Gaylor Electric,
Inc\Documents\WindowsPowerShell\Modules\passwordstate-management\4.4.1\Get-PasswordStatePassword.ps1:120 char:14

  • ... . "$(Get-NativePath -PathAsStringArray "$PSScriptroot","Passwo ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (:) [], FileLoadException
    • FullyQualifiedErrorId : System.IO.FileLoadException

Unable to find type [PasswordResult].
At C:\Users\dsolodow\OneDrive - Gaylor Electric,
Inc\Documents\WindowsPowerShell\Modules\passwordstate-management\4.4.1\Get-PasswordStatePassword.ps1:191 char:17

  •             [PasswordResult]$i = $i
    
  •             ~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (PasswordResult:TypeName) [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : TypeNotFound

Looks like it's not finding the PasswordStateClass.ps1; probably due to the non-alphanumeric characters in the path.
If I install the module for AllUsers it's happy.

It definitely looks like the comma in the path is preventing it from working. Interestingly do other modules work from the same path?

The reason i ask is when i created a path with a comma in to test i couldn't even open any .ps1 files from the dir with Powershell ISE.

Yep, I have a number of other modules in that path that all seem to behave fine. One of them is dbatools; I'm looking at how it does the invocation to see if I can find a fix.

@dsolodow the layout and loading of the module has recently be changed. Is this still an issue for you in the latest version?

Looks to be fixed as of 4.4.8. :)