Posts on Powershell

  1. Change default shell for OpenSSH on Windows

    If you are using OpenSSH on Windows the default shell used when connecting is cmd.exe. To update Windows to use something different you need to update the registry and restart the OpenSSH service.

  2. Managing hugo blog entries in Obsidian

    To make using and blogging simpler I have made some scripts, templates and quickadd commands to make a new article for my blog and then be able to run a PowerShell script to publish it.

  3. Extract tasks from Obsidian vault with Github actions

    I wanted to be able to pull my tasks out of my vault as a summary view, this can open up future automation options for me. However as I use multiple devices no single place was great and if I am on my phone it makes it harder.

    As I am synchronizing my vault with git I decided to use a github workflow to help me out. I have it setup to run once a hour and extract all the tasks that are visible in the Obsidian Tasks plugin. These can be found as they always have the global task tag in them. In this example I use #task, update the regex as needed.

  4. 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.

    powershell code snippet start

  5. 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.

    1. Press CTRL + , to open settings.
    2. Enter Shell: Windows in the search box.
    3. Scroll down to Terminal > Integrated > Shell: Windows
    4. Click on ‘Edit in settings.json’ and add the following.

    code snippet start

  6. 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.

  7. 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. You can set the values of global in your profile or in the launching script. As long as they are set this will work.

  8. 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 @ http://www.dinnovative.com/?p=348

  9. 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. This was as not straight forward as I wanted. I still have a issue that the process is polling and not a subscriber model but I do not have time to create a ISY binding. Anyway, here’s the basic instructions.

  10. 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!