diff --git a/helpers/PsInI/Get-IniContent.ps1 b/helpers/PsInI/Get-IniContent.ps1 index 11cab38..1681193 100644 --- a/helpers/PsInI/Get-IniContent.ps1 +++ b/helpers/PsInI/Get-IniContent.ps1 @@ -70,11 +70,14 @@ # Lines starting with the characters provided will be rendered as comments. # Default: ";" [Char[]] - $CommentChar = @(";"), + $CommentChar = @(";", "#", ":", "/"), # Remove lines determined to be comments from the resulting dictionary. [Switch] - $IgnoreComments + $IgnoreComments, + + [String] + $delimiter = '=' ) Begin { @@ -89,7 +92,7 @@ $commentRegex = "^\s*([$($CommentChar -join '')].*)$" $sectionRegex = "^\s*\[(.+)\]\s*$" - $keyRegex = "^\s*(.+?)\s*=\s*(['`"]?)(.*)\2\s*$" + $keyRegex = "^\s*(.+?)\s*$delimiter\s*(['`"]?)(.*)\2\s*$" Write-Debug ("commentRegex is {0}." -f $commentRegex) } diff --git a/helpers/PsInI/Out-IniFile.ps1 b/helpers/PsInI/Out-IniFile.ps1 index c52cd3c..5de18c6 100644 --- a/helpers/PsInI/Out-IniFile.ps1 +++ b/helpers/PsInI/Out-IniFile.ps1 @@ -103,7 +103,10 @@ Function Out-IniFile { # # Adds an extra linebreak between Sections [Switch] - $Pretty + $Pretty, + + [String] + $delimiter = '=' ) Begin { @@ -161,9 +164,8 @@ Function Out-IniFile { } } - $delimiter = '=' if ($Loose) { - $delimiter = ' = ' + $delimiter = "$delimiter " } # Splatting Parameters