Powershell: another alternative to ternary operator
In C# (as well as in Java and C++), you can use the ternary operator (?:) for a shorthand notation for conditionally assigning a value: var index = (a == "a") ? 1 : 2; In Powershell, such an operator...
View ArticleRunning chocolatey behind an authenticating firewall
I long grappled with a problem installing applications using chocolatey. Specifically, all installations that required downloading an MSI (or similar) file outside the .nupkg caused the following error...
View ArticlePowershell gotchas: standard out breaks lines to fit console
When Powershell writes to standard out, and there is now redirection in the Powershell script itself, it will assume that it writes to a console. Because of this, it kindly breaks lines if they are...
View ArticlePowershell gotchas: calling a function
Consider the following code: function f($a, $b, $c) { "f: `$a=$a, `$a.GetType()=$($a.GetType())" "f: `$b=$b, `$b.GetType()=$($b.GetType())" "f: `$c=$c, `$c.GetType()=$($c.GetType())" } f 1 2 3 # call f...
View ArticlePowerShell for developers: my talk on NDC Oslo 2013
On the Norwegian Developer’s Conference 2013 I gave a talk on PowerShell for developers. The video is now freely available: Vidar Kongsli: Powershell for developers from NDCOslo on Vimeo.
View ArticleHello, Azure Scheduler
The Scheduler is one of the new kids on the block in Azure Land. With Scheduler you can set up triggers for some sort of event in your system. It is currently in preview. I took some time to get to...
View ArticleSlå opp i ordbøkene fra Powershell
Å bruke kommandolinjen er kjapt. Hvis du ønsker å slå opp i Bokmålsordboka eller Nynorskordboka på nett, kan du nå gjøre det fra Powershell. Slik konfigurerer du dette: Hvis du ikke har det fra før,...
View ArticleMy PowerShell video course is available!
For the last months, I have been working on my PowerShell 5 recipes video course. It is now finally published! Why? Why make a video course? – you might ask. I come from a system development...
View ArticleManage your DNS records with PowerShell
In my video course PowerShell 5 Recipes, I used the Dnsimple API as an example of writing PowerShell modules. In the course, I uploaded and made the library available in the PowerShell gallery. Even...
View Article