Jaykul / PowerLine

A more PowerShell prompt
MIT License
567 stars 31 forks source link

PowerLine fails to import saved prompt including a single-quoted string #42

Closed Chirishman closed 5 years ago

Chirishman commented 5 years ago

When I run this interactively it works, however when I export it and reopen PowerShell and reimport PowerLine it throws at line 6.

Looking at it more closely it looks like it's some kind of bug in the Configuration module maybe? Or maybe just in the export command. Let me know if you'd rather track this on Configuration.

https://gist.github.com/Chirishman/ad7ab9492f9972d77536e89fb1f02053

Error:

Import-Metadata : Exception calling "Create" with "1" argument(s): "At line:1 char:63
+ New-PromptText -Fg White -Bg 20 (((Get-SegmentedPath) -replace
+                                                               ~
You must provide a value expression following the '-replace' operator.
At line:1 char:63
+ New-PromptText -Fg White -Bg 20 (((Get-SegmentedPath) -replace
+                                                               ~
Missing closing ')' in expression."
At C:\Program Files\WindowsPowerShell\Modules\Configuration\1.3.1\Configuration.psm1:417 char:21
+ ...             Import-Metadata $EnterprisePath -ErrorAction Ignore -Orde ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Metadata], MethodInvocationException
    + FullyQualifiedErrorId : ParseException,Import-Metadata
Jaykul commented 5 years ago

Yeah, this needs to be on Configuration -- it's a bug on the export (serialization)

Chirishman commented 5 years ago

Should this be closed now? You fixed published the fixed Configuration module right?