Cleanup Empty Azure Resource Groups

I needed to cleanup empty groups on a test subscription I had, using the Azure Cloud shell the following script will do it for you. az group list -o tsv --query [].name | % {$resources = az resource list -g $_ -o table; if($resources) {"$_ has Resources"} else {"$_ has no resources"; az group delete -n $_ -y --no-wait}}

June 23, 2021 · 1 min · Jon Bullen

Using PowerShell core in Visual Studio Code on windows

This is more for me than anyone else. If you want to move to PowerShell core in Visual Studio Code then do the following. Press CTRL + , to open settings. Enter Shell: Windows in the search box. Scroll down to Terminal > Integrated > Shell: Windows Click on ‘Edit in settings.json’ and add the following. “”: “C:/Users/${env:USERNAME}/scoop/apps/pwsh/current/pwsh.exe”, “”: “C:/Users/${env:USERNAME}/scoop/apps/pwsh/current/pwsh.exe”, Now when the terminal is opened it will be using PowerShell Core....

March 15, 2019 · 1 min · Jon Bullen

Filling your calendar for the week, increase productivity! Mileage may vary

I like to ensure my calendar gets filled for the next week, this way I know what is happening and it is hard to book a last minute meeting to surprise me. I guess this is a productivity hack. If you book more than a week out then you can take whatever time you want that is open. Ideally no one books last minute but they do and it is really annoying to deal with....

June 25, 2018 · 1 min · Jon Bullen

New PowerShell module for Home Assistant

So after making the PowerShell script for Home Assistant I decided to spend a hour and pull it together to be a full module and push it up to GitHub. This is now in place and support just turning a switch entity on and off. Installation Install-Module -Name PoshHomeAssistant -Scope CurrentUser Usage Before you can use it set the configuration, this can be done with the following command, set the key and url to match your environment....

June 7, 2018 · 1 min · Jon Bullen

Getting PowerShell to work with Home Assistant

I wanted to turn on and off my office lamp from my desktop, sure I can use a switch but it is hooked up to Home Assistant so lets make it automatic! The main scenario was to toggle it at 10pm so when I get distracted it will let me know the time. You can use this for just about anything and at some point I will add more functions. Here is the snippet for now....

June 6, 2018 · 2 min · Jon Bullen

Rooting the WINK Hub with Windows

I do have a Linux machine in the house but that is on a Pi running as a squeezelite client for my house music collection. So looking at the instructions on the web I have translated them for use in Windows. Of course I have use PowerShell! The only addition I have is I use Kitty as a SSH client. This uses the approach @ Open up the box and plug in the WINK unit....

February 13, 2015 · 2 min · Jon Bullen

Integrating ISY into OpenHAB

I am in the process of setting up OpenHAB for the extra functionality in my house. I have the ISY unit setup as the core brains for switches and scenes. All the other magic is in OpenHAB so if OpenHAB goes down the main functions of the house work. I wanted to get the OpenHAB system to be able to get the status from the ISY unit and also changes states....

January 1, 2015 · 2 min · Jon Bullen

Home automation with ISY and PowerShell

I am playing with ISY and automation in my home, looking at the universal devices page today I found the API for working with the unit. Turning to trusty PowerShell I came up with the following code to enable you to start interacting with the unit remotely. Ill look at a proper module at some point in the future but this increases the possibilities of the unit! [code] function Invoke-IsyRestMethod { param ( $RestPath ) $isyEndPoint = “http://192....

October 30, 2014 · 1 min · Jon Bullen

Getting the Central Admin URL for a Farm in SharePoint

I recently needed to get the Url of the CA for a SharePoint farm, after a bit of hunting in the API it was tracked down under the SPAdministrationWebApplication object. C# [code lang=“csharp”] SPAdministrationWebApplication caWebApp = Microsoft.SharePoint.Administration.SPAdministrationWebApplication.Local; var url = caWebApp.Sites[0].Url; [/code] PowerShell [code lang=“ps”] $caWebApp = [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local $caWebApp.Sites[0].Url [/code]

July 30, 2010 · 1 min · Jon Bullen