Event 1: My way…

This year judges should focus on blogging. I’ve decided that it may be helpful to give attendees chance to return the favor – I will blog about things I like and dislike in your scripts. At the same time – I will post how I would do it. Feel free to complain, point out mistakes. I will try to post it as soon as entries are closed for submissions, so that I will do it “fresh” before I see any of your scripts – this way I won’t “steal” your ideas. Puszczam oczko

Continue reading

Advertisements

PowerShell Web Access puzzle.

PowerShell-Web-Access-LogoPowerShell Web Access is great new feature, that allows us run PowerShell inside web browser. So far I was thinking of it as something that is either save but slightly inconvenient (when we have to connect to constrained endpoint running with RunAs credentials) or slightly insecure with cool features like tab completion and full cmdlet coverage, including all *-Object cmdlets (if we connect with more privileged account to “normal” endpoint). Either – or. But last Friday I came up with idea that can give us a little bit of both. Idea, that I would like to share.

Continue reading

v3, AST and dot-sourcing.

How often do you find yourself in situation, when you would like to import functions from one of your scripts? Issue with that is related to the fact, that most of scripts I write have some purpose and they “do stuff”. When I want to import functions from the script I do not want to perform tasks that script would normally do – I just want function(s).

Continue reading

Quick tip: replace it (slightly) smarter.

I try to use regular expression as much as I can. Mainly because this gets really “rusty” very quickly when not used. What I like to use very often is PowerShell’s operator –replace. It works wonders, especially when combined with named and numbered captures. But there are situations where this syntax can be hard to apply. I was walking around those issues in the past until I finally came up with solution that seems obvious if you think of it for a minute – so I’m probably not the first one that came up with it. If you did it few years ago – please feel free to look down on me. Puszczam oczko

Continue reading