Skip to main content

Posts

Showing posts with the label code

Something completely different – PoshARM

I needed a project for my Xmas holiday and I needed something remotely work related. Thus the dubious PoshARM PowerShell module was born and brought to life during my Xmas holiday. Simply put it is a module that lets you build – for now – simple Azure Resource Manager (ARM) templates with PowerShell .  The module can also import templates from a file or from the clipboard/string. Your partial template or ready made template can be exported as a PowerShell script. This blog post will walk you through how to use it and the features that is currently implemented.  Update 08.02.2017: The module is now published to the PowerShellGallery ( https://www.powershellgallery.com/packages/posharm ). It is still in beta version, however test coverage have increased and some bugs have been squashed during the testing. Also help is present, however somewhat lacking here and there. Update 18.01.2017: The module is now on GitHub. Here is the link to the repro  ( PoshARM on GitH...

Help yourself if you ask for help

This is a slight modification of a Reddit post I created a few months ago. It was written for Reddit, however the analogy works even if you ask for help anywhere else too. I have not been on Reddit for long, however I have been watching the posts being submitted. In all fairness, I have a couple of suggestions to you if you need help with something larger than a commandline or suggestion of a command line: How to ask for help Always state the goal of the solution.   What is the problem you have decided to try and solve. If your solution is to produce output, explain what it should output and what form (console, xml, json, text, csv etc). How will the solution be executed (as a script, as part of an module or as an function) If your solution is not working, share the whole script/function included dependency code, not just the line/command/function that is not working. If you code requires parameters and your code does not include any help/comments on how it works, ...

Bulk Import Operations Manager 2012 Management Packs

Read a post today from Joe Thompson regarding this subject. Really liked the idea with bulk import of Management Packs. The scenario is like this: You have a folder or several folders with a bunch of Management Packs and you want to install only those that is currently not installed. I hope Mr Thompson does not mind me changing his Powershell script and "improving" it slightly if you ask me :-) [cmdletbinding()] Param ( [ValidateScript({Test-Path $_ -PathType 'Container'})] [string] $ManagementPacksPath ) Write-Verbose "Creating an array of file names from the path $ManagementPacksPath" $MPfiles = (Get-Item -Path "$ManagementPacksPath\*" -Include *.mp*).Name [int]$CountMatching = 0 $InstallList = @() foreach($MP in $MPfiles) { Write-Verbose "Getting MP properties using SCOM cmdlet and the parameter 'ManagementPackFile'" $MPproperties = Get-SCOMManagementPack -ManagementPackFile "$ManagementPacksPath\...

Lightswitch - HTMLclient

It has been to long since my last post. As everyone else I have had trouble with finding time to blog.  Recently I have been playing with the new Visual Studio Lightswitch (you can get update 2 here:  http://www.microsoft.com/en-us/download/details.aspx?id=38188 ). Why is it so cool, because it is pure HTML5 and will run in any modern browser being Mac, PC, tablet, IPAD, Iphone, Androd etc.  There are some nice posts out there to get you started, however I was looking for a way to on-the-fly created dropdown lists boxes (what we call ChoiceList in Lightswitch). I found this blogpost about someone else wondering about the same thing: http://www.datazx.cn/Fv7p5a/6x-DE/y10q2an129q/2q7xs6/6mdggtxi-id9i-f4ij-s8ms-i94bt9tfcjg423rsdfd.html That guy Huy is pretty awesome (he as an answer to almost every question), and I felt all hope was lost when he stated that it was not possible. Reading further down, I noticed this guy pointing me ...