Skip to content

Instantly share code, notes, and snippets.

$path = "C:\Testing\File.xml"
[Xml]$servicefactoryconfig = Get-Content -Path $path -Raw
$old = $servicefactoryconfig.SelectSingleNode("/factory/map/add[@key='Audit']")
$parent = $old.ParentNode
[void] $parent.RemoveChild($old)
$newNode = [Xml] @'
@altrive
altrive / ToastNotification_Windows10.ps1
Last active November 17, 2023 14:21
Windows 10 toast notification sample
$ErrorActionPreference = "Stop"
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString()
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
#Convert to .NET type for XML manipuration
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null
@alexeds
alexeds / move-stashes.md
Created September 5, 2012 18:00
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.