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.
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.