PSProfile icon indicating copy to clipboard operation
PSProfile copied to clipboard

Errors when paths in project path starts with a digit

Open janegilring opened this issue 6 years ago • 5 comments

Some paths in one of my project folders contains dots and underscores. This leads to errors when loading PSProfile:

Import-Metadata : At C:\Users\janring\AppData\Roaming\powershell\SCRT HQ\PSProfile\Configuration.psd1:76 char:18
+   GitPathMap = @{
+                  ~
Missing closing '}' in statement block or type definition.
At C:\Users\janring\AppData\Roaming\powershell\SCRT HQ\PSProfile\Configuration.psd1:77 char:5
+     2019MVPDagen_org = 'C:\Users\janring\Git\2019MVPDagen_org'
+     ~~~~~~~~~~~~~~~~

janegilring avatar Oct 25 '19 04:10 janegilring

Hey @janegilring - This appears to be an issue with the Configuration module and how it's serializing / deserializing hashtable keys. Going to check it out, shouldn't be too difficult to replicate! CC: @Jaykul

scrthq avatar Oct 28 '19 06:10 scrthq

So, the odd part is that I have projects with underscores as well, but they don't seem to break it like the error is reporting for you.

If you inspect the configuration file, do you see any points where the syntax breaks?

code $PSProfile.Settings.ConfigurationPath

scrthq avatar Nov 02 '19 16:11 scrthq

The issue might not be underscores after all. I`ll send you my complete autogenerated GitMapPath in a DM.

janegilring avatar Nov 02 '19 17:11 janegilring

Filling in here, it looks like the issue is with keys on the manifest that start with an integer not being liked too much by PowerShell. Need to fix within Configuration so that any dictionary key starting with an int is wrapped in quotes CC @jaykul

scrthq avatar Nov 02 '19 18:11 scrthq

Opened up https://github.com/PoshCode/Configuration/pull/37 to resolve this!

scrthq avatar Nov 02 '19 19:11 scrthq