Skip to content

Instantly share code, notes, and snippets.

@dindoliboon
dindoliboon / Set-PropertyValue.ps1
Created June 20, 2017 14:36
Updates simple property files.
function Set-PropertyValue
{
[CmdletBinding()]
param($Path, $Key, $Value, $Separator='=', $Comment="# ", $Backup=$true)
$ini = Get-Content -Path $Path
$newIniPath = [System.IO.Path]::GetTempFileName()
$found = $false
$ini.Split("`n") |% {