You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ConvertFrom-VDF function of the SteamTools.psm1 file on line 43, the regular expression (?<=")([^\"\t\s]+\s?)+(?=") doesn't account for escaped double quote marks (\") inside a quoted element. Steam is able to escape double quote marks when reading and writing to VDF files. If a quoted element has escaped double quotes, this function will fail to add that element.
A vdf with the following app section will not have the LaunchOptions object added via the Add-Member command. Example within "Software" { "Valve" { "Steam" { "apps" { ...
I've reworked both the ConvertFrom-VDF and CovnertTo-VDF functions within SteamTools.psm1 to better work with VDFs and will put in a pull request for this. I've been struggling with the regular expression but finally got it working well. I had to change the CovnertTo-VDF function completely to use one for loop instead of the multiple foreach loops since foreach does not retain the order we originally used in CovnertFrom-VDF. Now a config file converts to a PSCustomObject and then back to a VDF perfectly, without any data loss or order changes. I ran file comparisons and they're identical now.
New regular expression in ConvertFrom-VDF: (?<=^|\t|{|\n)"((?:[^"\\]|\[\"])*)"(?=\t|\n|$|})
I originally wanted to remove the quote marks on each member name, but realized two things: 1.) we should leave them there for safety reasons, and 2.) leaving them means a much less complex regular expression (it was twice as long to remove them).
In the ConvertFrom-VDF function of the SteamTools.psm1 file on line 43, the regular expression (?<=")([^\"\t\s]+\s?)+(?=") doesn't account for escaped double quote marks (
\"
) inside a quoted element. Steam is able to escape double quote marks when reading and writing to VDF files. If a quoted element has escaped double quotes, this function will fail to add that element.A vdf with the following app section will not have the LaunchOptions object added via the Add-Member command. Example within "Software" { "Valve" { "Steam" { "apps" { ...
Thanks!
The text was updated successfully, but these errors were encountered: