You can create custom event logs in PowerShell using the New-EventLog cmdlet, and then use the Write-EventLog cmdlet to write events to the log. Here’s an example: In this example, the New-EventLog cmdlet is used to create a new event log named “MyScriptLog” with a source of “MyScript”. The Write-EventLog cmdlet is then used to […]
PowerShell
Setting Up Pester Tests
Hey, how are you doing? Thought I would write about setting up Pester tests, and the structure I use. This comes about because when I need to start a new project and have some Pester tests running against the infrastructure I have a standard setup I use. So I decided to share it as it […]
AKS Azure Kubernetes Services – Private AKS Endpoint.
Check out my github repo for an ARM Template that deploys AKS. https://github.com/PinportLtd/Kubernetes-AKS Private AKS Endpoint. If you enable the AKS private endpoint you can ensure network traffic between your API server and your node pools remains on the private network only. Which is great for security. But it also means your k8s API is […]
WinRM
WinRM seems a very complicated way to access a server. But it can be easier if you know the basics. Remote Machine – The Server you want to connect to To start on the machine you want to connect to, you need to set up WinRM and enable PSRemoting (PowerShell Remoting). This can be done […]
Querying API’s using PowerShell Commands
It’s always useful to have these commands at your fingertips when you need to get or post some information to an API. I’m going to cover three of Microsoft API’s here. Azure DevOps API Azure Rest API Azure Graph API The Azure DevOps API is used to interact with Azure DevOps; you can create release […]
Useful Azure Virtual Machine’s Images for Arm and Terraform Templates
I get stuck when considering which image to use for my virtual machines. Has a new image come out??? What options are available to me now? There are so many to choose from. To use virtual machine images, there are four parts that you need to find to reference them in your code. Publisher: The […]
Create an Azure Service Principal for Terraform
To use Azure and Terraform together you need a way to authenticate against the Azure Tenant. Like you do as a user, applications need a way to do the same. But instead of creating a user account, we create a Service Principal account. To do this we need to register an application in Azure Active Directory. […]
Set up WinRM for a Azure Virtual Machine using Terraform Code
How to set up Terraform to allow WinRM swift and easy.