Series of short snippets of FUC. This one is for PowerShell.
March 6, 2019powershell
A few snippets of PowerShell I’ve found useful over and over again. Most of them are just syntax/functions that I’m unable to remember, some of them might be more complex.
It’s a living document, I keep updating it.
$xmlDoc = [XML](Get-Content $filePath) $xmlDoc.Element.Subelement.setAttribute("Attr", $value); $xmlDoc.Save($filePath)
$jsonDoc = Get-Content $filePath | Out-String | ConvertFrom-Json