Skip to content

Commit

Permalink
Release v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lipkau authored Mar 23, 2019
2 parents 1b101ef + 0680b85 commit 99f3ba9
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 20 deletions.
1 change: 0 additions & 1 deletion PSIni/Functions/Add-IniComment.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Set-StrictMode -Version Latest
Function Add-IniComment {
<#
.Synopsis
Expand Down
14 changes: 8 additions & 6 deletions PSIni/Functions/Get-IniContent.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Set-StrictMode -Version Latest
Function Get-IniContent {
Function Get-IniContent {
<#
.Synopsis
Gets the content of an INI file
Expand Down Expand Up @@ -88,7 +87,9 @@ Function Get-IniContent {

Write-Verbose "$($MyInvocation.MyCommand.Name):: Function started"

$commentRegex = "^([$($CommentChar -join '')].*)$"
$commentRegex = "^\s*([$($CommentChar -join '')].*)$"
$sectionRegex = "^\s*\[(.+)\]\s*$"
$keyRegex = "^\s*(.+?)\s*=\s*(['`"]?)(.*)\2\s*$"

Write-Debug ("commentRegex is {0}." -f $commentRegex)
}
Expand All @@ -97,6 +98,7 @@ Function Get-IniContent {
Write-Verbose "$($MyInvocation.MyCommand.Name):: Processing file: $Filepath"

$ini = New-Object System.Collections.Specialized.OrderedDictionary([System.StringComparer]::OrdinalIgnoreCase)
#$ini = @{}

if (!(Test-Path $Filepath)) {
Write-Verbose ("Warning: `"{0}`" was not found." -f $Filepath)
Expand All @@ -105,7 +107,7 @@ Function Get-IniContent {

$commentCount = 0
switch -regex -file $FilePath {
"^\s*\[(.+)\]\s*$" {
$sectionRegex {
# Section
$section = $matches[1]
Write-Verbose "$($MyInvocation.MyCommand.Name):: Adding section : $section"
Expand Down Expand Up @@ -133,13 +135,13 @@ Function Get-IniContent {

continue
}
"(.+?)\s*=\s*(.*)" {
$keyRegex {
# Key
if (!(test-path "variable:local:section")) {
$section = $script:NoSection
$ini[$section] = New-Object System.Collections.Specialized.OrderedDictionary([System.StringComparer]::OrdinalIgnoreCase)
}
$name, $value = $matches[1..2]
$name, $value = $matches[1, 3]
Write-Verbose "$($MyInvocation.MyCommand.Name):: Adding key $name with value: $value"
if (-not $ini[$section][$name]) {
$ini[$section][$name] = $value
Expand Down
1 change: 0 additions & 1 deletion PSIni/Functions/Out-IniFile.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Set-StrictMode -Version Latest
Function Out-IniFile {
<#
.Synopsis
Expand Down
1 change: 0 additions & 1 deletion PSIni/Functions/Remove-IniComment.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Set-StrictMode -Version Latest
Function Remove-IniComment {
<#
.Synopsis
Expand Down
1 change: 0 additions & 1 deletion PSIni/Functions/Remove-IniEntry.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Set-StrictMode -Version Latest
Function Remove-IniEntry {
<#
.Synopsis
Expand Down
1 change: 0 additions & 1 deletion PSIni/Functions/Set-IniContent.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Set-StrictMode -Version Latest
Function Set-IniContent {
<#
.Synopsis
Expand Down
9 changes: 1 addition & 8 deletions PSIni/PsIni.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@
# Generated by: Oliver Lipkau
#
# Generated on: 5/3/2013
# Revisions:
# 2015-06-01 - CB - incremented ModuleVersion to match .psm1 file
# 2015-06-18 - OL - Migrate to semantic versioning (GitHub issue#4)
# 2015-07-14 - OL - Merge Pull Request #7
# 2015-10-14 - OL - Multiple improvments
# 2016-08-11 - SS - Added Comment, Uncomment, Remove and Update functions
# 2016-12-13 - OL - release 1.2

@{

# Script module or binary module file associated with this manifest
RootModule = 'PsIni.psm1'

# Version number of this module.
ModuleVersion = '2.0.0'
ModuleVersion = '3.0.0'

# ID used to uniquely identify this module
GUID = '98e1dc0f-2f03-4ca1-98bb-fd7b4b6ac652'
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ environment:
PSGalleryAPIKey:
secure: s9Uw6gnBI2xdDYtpJE5m8C3eDvrXBDGO/abptsu9NCtCrdxoU/N+3YfjffOTysw+

version: 2.0.{build}
version: 3.0.{build}

# Don't rebuild when I tag a release on GitHub
skip_tags: true
Expand Down

0 comments on commit 99f3ba9

Please sign in to comment.