Phil-Factor / PSYaml

A Powershell module to convert YAML documents to and from PowerShell objects
MIT License
91 stars 32 forks source link

Closed the open file stream #23

Closed hsitin closed 6 years ago

hsitin commented 6 years ago

1) When convertfrom-yaml is being used on a yaml file and if an error occurs while parsing it, then the file cannot be modified until the powershell session is closed. Fixed it using $streamReader.Close()

2) Extracted the common code in the if and else section of convertfrom-yaml to make code more readable.

Phil-Factor commented 6 years ago

Thanks for the contribution