PowerShell and cd..

When I just started to learn PowerShell, my first book was Learn Windows PowerShell in a Month of Lunches I remember one very interesting quote from it Technically, Cd.. is incorrect because it doesn’t include a space, and Cd .. is correct. In reality, PowerShell v2 catches the Cd.. error and will do the right …

Name collisions, PSBase and other mad PowerShell internals

Sometimes, we can discover name collisions in PowerShell Consider example When we call we get tag but when we call we get attributeValue That’s happened because of the name collision XmlNode.Name property vs automatic NoteProperty name constructed from the attributes So the question is how to get tag name from $xml2 as well. It took …

Set-StrictMode and legacy code issues

I am a big fan of Set-StrictMode cmdlet. I always add into all my PowerShell scripts, this helps a lot to catch typos and call for missing variables earlier. However, that’s ok if you work with your own scripts only. But if you call some legacy scripts from your script, you can discover many hidden …

Sublime Text missing feature – pin tab

I like Sublime Text editor very much. Recently even bought my own license for it. One thing is missing for me – is ability to pin tab and prevent it from closing.http://www.sublimetext.com/forum/viewtopic.php?f=4&t=493 Especially it is useful when I do search in files and want to make a change in all of them. I press Ctrl+W but I …