Skip to main content

Posts

Showing posts from October, 2015

Powershell Gallery – For your pleasure

Sad to say this, however I received an account for Powershell Gallery to be able to submit modules to the new PowershellGet (formerly know as OneGet)  ecosystem a looong time ago. Today was the first time I published a module to the repository. The work involved was, like I expected, very light. Process went smoothly and my module was uploaded within 10 seconds. If you have not looked into it yet, I highly recommend you start to dig in. The statistics on www.powershellgallery.com show that there is a dramatic increase in downloads the last couple of months. I expect this to increate as time goes by and by the fact that there is a package management preview available for people with Powershell version 3.0 or 4.0 running in Windows Server 2008 R2, Windows7, Windows8, Windows Server 2012 and 2012 R2 ( download link ). Please note that the preview is dependent on .Net version 4.5. First module So what did I upload as my first module? Well after being on Windows 10 for a couple of

Use powershell to validate Email address

A time comes along when you need to validate an Email address using Powershell. Created a function just for this purpose as an introduction to how you may create advanced functions in powershell. This function will “validate” an email address using the System.Net.Mail namespace and output an Boolean value indicating if an string is a valid address. It uses a structure and style that is my personal preference. Feel free to comment if you like. Basic learning points It is an advanced function It supports the pipeline It displays how to create an instance of a .Net class Cheers Tore

What is around the corner for IT-Pros – Part 2

This is part 2 of a multi post around topics discussed in Part1 . Next up is Hybrid Cloud and how it will impact us and why it is the way of the future. Hybrid cloud Microsoft changed their focus a couple of years ago, from the primary solution provider for enterprise software running in datacenters to a Mobile/Cloud first strategy. Their bet was that the cloud would be more important and that the economic growth would be created in the emerging cloud market. Needless to say that it looks like their bet is paying of tenfold. Azure Over the last year there have been a significant number of announcements that connect Azure to your datacenter, thus enabling enterprise to utilize cloud resources with enterprise On-Prem datasources or local hybrid runbook workers. It should not come as any surprise that this trend is accelerating in preparation for the next big shift in hybrid technology, that is expected to be released with Windows Server 2016 – Microsoft Azure Stack. Before we

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, explain w

Powershell – Log like you mean it

How do you do logging in powershell? Why should you do logging? What should you log? Where do you put your log? How do you remove your log? How do you search your log? All important questions and how you answer then depends upon what your background is like and the preferences you have. This will be a 2 part blog post and this is part 1. Why should you log? Well it is not mandatory, however I have 2 reasons: Help with debugging a script/module/function Self documenting script/module/function Firstly; Do you know any program that does not contain any bugs? Working with IT for the last 2 decades, I cannot name one. When you create scripts/modules/functions, you will create bugs, that is where they live and try to make your life a living mess. Secondly: Adding a little extra information to your logging will make them self documenting. Do you like writing documentation? Well I normally am not fond of it and use logging while debugging to get two birds with one stone. What