[WTF] Exception.ToString() and FaultException

Today I’ve got another WTF. I found that inner fault exception is not included into outerException.ToString() And the output is You can see that inner exception message was not passed to the output. However if you call you will get fault details with inner exception This behavior is very bad. In our current project we …

PowerShell Get-Content vs [System.IO.File]::ReadAllText

The difference between and That first one returns array of lines in the file and second returns one string for whole file. There are couple of other ways to achieve second behavior with Get-Content as well According to this in PowerShell 3 you can do that using new parameter Raw The solution that works in …

PowerShell + XAML => GUI

You can use WPF GUI from PowerShell using the following snippet UPDATE: I found that this will work out of the box only in PowerShell 3. In previous versions of PowerShell it will fail on line #13 The problem is with STA. According to this -Sta Starts Windows PowerShell using a single-threaded apartment. In Windows …

Guide how to easy screw up your git repository

Yesterday I screwed up our git and we spent more than 2 hours to clean the mess, investigate how this happened and how to help other developers to fix that. Background We have git with master and release branches. We have a RULE: never ever merge release with master. Only backward master with release. When …

PowerShell Sort-Object and Hashtables

Maybe this will be obvious for everyone but I would like to share it anyway because I had some WTFs today 🙂 I had an array of objects with anonymous type and I wanted to sort them by some property. I was surprised but last command did not work as expected. My array still remained …

PowerShell + Git = posh-git

We want to have better command completion with Git from console. We are lucky because of the posh-git Now we can type git co – press Tab and get completion to git commit or even more interesting git checkout – Tab – can switch between available Installation is very simple especially with PsGet That’s it! …