Skip to content

Instantly share code, notes, and snippets.

@glombek
Last active August 19, 2019 08:20
Show Gist options
  • Save glombek/46074c539bc1699969feba08ae9a801e to your computer and use it in GitHub Desktop.
Save glombek/46074c539bc1699969feba08ae9a801e to your computer and use it in GitHub Desktop.
A quick workaround to move all uSync macro keys from a node to an attribute (see https://github.com/KevinJump/uSync/issues/231) - just place in the uSync\data\macro folder and run
# Get all .config files in the current folder
Get-ChildItem "./" -Filter *.config |
Foreach-Object {
[xml]$xml = Get-Content $_.FullName
# Add Key attribute
$macroNode = $xml.SelectSingleNode("macro")
$macroNode.SetAttribute("Key", $xml.macro.Key)
# Remove Key node
$keyNode = $xml.SelectSingleNode("macro/Key")
$macroNode.RemoveChild($keyNode)
$xml.Save($_.FullName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment