Jaykul / EzTheme

An extensible module for PowerShell color themes
MIT License
12 stars 1 forks source link

unable to load type on mac #1

Open lipkau opened 1 year ago

lipkau commented 1 year ago

Unable to use on mac. The error that I get when running import-DefaultModule is bellow.

Looks like ITheme is not available

Cannot convert value "/Users/LIO2MU/.local/share/powershell/Modules/EzTheme/0.1.0/Themes/Darkly.theme.psd1" to type "Theme". Error: "Exception calling "InvokeReturnAsIs" with "1" argument(s): "Cannot process argument transformation on parameter 'Type'. Cannot convert the "PoshCode.PowerLine.PowerLineBlock" value of type "System.String" to type "System.Type".""
At /Users/LIO2MU/.local/share/powershell/Modules/EzTheme/0.1.0/EzTheme.psm1:246 char:9
+          >>>$Theme = [Theme]$Path<<<
Jaykul commented 1 year ago

Hmm. One of the problems with serializing custom types is that if you try to deserialize and the type isn't available, it doesn't work right. I'll have a look at PoshCode/Metadata to see if I can make those just import as PSCustomObject when the type isn't available (instead of crashing).

In the meantime, you just need to either install PowerLine, or delete the "PowerLine" block from that Darkly theme.

https://github.com/Jaykul/EzTheme/blob/58c5883514f787e42e0cd4aaef864c299542cc2d/Source/EzTheme/Themes/Darkly.theme.psd1#L107-L192