Showing all posts tagged: 'PowerShell'

A 15-post collection

The new Azure Powershell Resource Manager - 1.0 Preview

The new Azure PowerShell preview module is out. I use PowerShell on Azure to automate many tasks and it's something that we use in the team quite frequently. Yes, you can use the Azure Portal (website) to accomplish the same tasks but I like using PowerShell for a few reasons: Create repeatable and consistent tasks Share the files and knowledge that comes with it Automate all the things! This preview release is the first major version taking it to 1.0. Unfortunately, it brings some breaking changes with it. For this reason, it's imperative that you read the documentation before …[read more]


Generate Guids with PowerShell or ScriptCs

There are many ways to generate GUIDs. You can use one of the many free websites or you can write your own (quick) script to do it. If you want to create your own script, there are 3 easy approaches: PowerShell ScriptCs Uuidgen.exe The first two are very powerful and versatile and can do a lot more than just generating GUIDs. The 3rd one is a dedicated utility for generating GUIDs only. PowerShell PowerShell is first as it's the easiest of the 2. Easiest to get started, that is. PowerShell is already installed on your Windows machine. Just bring …[read more]


Execute SQL Query with PowerShell

Scripting is very powerful. And for me, one of the best scripting languages is PowerShell (PoSH). Yes, PoSH takes a bit of getting used to, but once you pass the initial learning curve, you end up with a powerful tool in your hands. One thing that I love about PoSH is a little secret that not many people know: PowerShell allows you to import .NET namespaces and libraries and, in effect, you can write C# code to solve any problem you may have. The PowerShell's libraries, cmd-lets are very comprehensive but you can always come against something not "natively& …[read more]


Using PowerShell to resolve Host names to IP address

Today's post is to be a quick one, more like a useful DevOps tip. Today, I was given a list of hosts that I had to resolve to IP addresses in order to add them to a config file. Obviously there are a few ways to do this, but I wanted to automate it because you never know when someone will request something similar. Powershell to the rescue then. The script is pretty simple and I bet that it can be condenced even more, but I like my code and scripts as readable as possible. It is handy to remember …[read more]


Copying VHDs between private storage accounts

If you ever need to copy VHDs between two different storage account, you can use the PowerShell script below to do it in few steps: Perform the copy Firstly select the subscription you need to work with. Select-AzureSubscription "MySubscriptionName" Define the source VHD - authenticated container. You can get the vhd name and url from the portal $srcUri = "https://mysubscription.blob.core.windows.net/vhds/yourvhdname.vhd" Define the source Storage Account. This is where the vhd is currently located. The Private key can be acquired from the azure portal $srcStorageAccount = "sourceStorageAccount" $srcStorageKey = " …[read more]



Setting up a new Windows 8.1 machine the easy way - using Chocolatey Nuget

I admit it! I like new, shiny things. Besides, I wanted to sync all my devices (Surface and laptop) to the same version of the OS. The Surface Pro upgrade was a breeze. Since I don’t keep any data on my Surface, it was a case of just running the upgrade. However, the laptop upgrade wasn’t as straightforward, since I’m running Windows 8 on a Mac Book Pro Retina using Bootcamp. Yes, I know, it’s wrong, but I like it so deal with it. Since the inline upgrade didn’t work and rendered my machine useless …[read more]