Skip to content

Commit

Permalink
Merge pull request #36 from SeverinLeonhardt/fix_accessing_dictionary…
Browse files Browse the repository at this point in the history
…_keys

Fix accessing dictionary keys
  • Loading branch information
lipkau committed Sep 13, 2017
2 parents 2730f63 + c68fb04 commit d65d46c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PSIni/Functions/Out-IniFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ Function Out-IniFile {

Process
{
if (!($InputObject.keys))
if (!($InputObject.get_keys()))
{
Write-Warning ("No data found in '{0}'." -f $FilePath)
}
Foreach ($key in $InputObject.keys)
Foreach ($key in $InputObject.get_keys())
{
if ($key -match "^Comment\d+") {
Write-Verbose "$($MyInvocation.MyCommand.Name):: Writing comment: $key"
Expand Down Expand Up @@ -203,7 +203,7 @@ Function Out-IniFile {
if (!(Test-Path $outFile.FullName)) {Throw "Could not create File"}

Write-Verbose "$($MyInvocation.MyCommand.Name):: Writing to file: $Filepath"
foreach ($i in $InputObject.keys)
foreach ($i in $InputObject.get_keys())
{
if (!($InputObject[$i].GetType().GetInterface('IDictionary')))
{
Expand Down

0 comments on commit d65d46c

Please sign in to comment.