Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Stuffs from real IT system ADMINISTRATORS world and my LAB

Create PowerShell array of object in different way

When working with arrays and PSObject in PowerShell, there are several efficient methods for creating and managing array elements. Below are examples that highlight both the creation of arrays and the addition of elements in different ways. 

To create an empty array in PowerShell, you have two main options:

  1. Using [System.Collections.ArrayList]
    This method initializes an ArrayList, w…

Read more

Broadcom VMware PowerCLI based ESXi capacity planner html web portal

I had a requirement to provide a solution for monitoring ESXi servers' CPU, memory, and datastore usage to non-IT or developer users without giving them direct access to vCenter or ESXi servers. The solution needed to avoid using any additional applications or tools. Previously, I had set up a system pipeline where the data was delivered in CSV or Excel format. However, I thought it would be more …

Read more

PowerCLI List Add Delete Role Assignment account user on ESXi server with esxcli

I faced a scenario where I needed to automate the execution of a shell script on VMware (Broadcom) ESXi servers, version 7. The task involved renaming /etc/rc.local.d/local.sh to a .bak extension and restarting all services using /sbin/services.sh restart, which was necessary to resolve VM disconnection issues. Normally, this task is straightforward if you have the root username and password of ES…

Read more

Deploying Azure ARM templates using Terraform

This article demonstrates how to deploy an Azure ARM template using Terraform. I encountered several scenarios where resources deployed through Terraform, Bicep, or the REST API didn't function as expected. However, when I deployed the same resources using an ARM template, they worked flawlessly.

For example, in one case involving Scheduled Query Rules with Action Groups or Log Analytics, the d…

Read more

Azure resource group deployments with ARM JSON templates in Subscription with PowerShell

In this article, this example shows how to deploy resource group in Azure subscription. While deploying resource group with PowerShell you need to use New-AzSubscriptionDeployment cmdlet. Below is the output after deploying Resource Group in the subscription.

.\091-Complete_ARM_Template> # Create a hashtable for parameters
$templateParameters = @{
    rgLocation = 'eastus'
    rgName     =…

Read more

Deploy CPU quota usage alerts for subscription using Terraform azapi provider

This is another way of deploying resources/services on Azure using azapi provider using HashiCorp Terraform.

AzAPI is a lightweight, flexible provider that leverages the Azure ARM REST APIs, empowering you to manage any Azure resource type with any desired API version. This enables access to the latest Azure features and functionality.
Key Benefits:
Compatibility with any API version
Design…

Read more

Configure CPU quota usage alerts for subscription using Azure Bicep templates

This article is a continuation of my previous post, where I deployed CPU quota usage alerts for a subscription using Azure ARM templates. In this post, I'll demonstrate how to deploy Action Groups and Subscription Quota Alerts for CPU usage using Bicep.

Compared to ARM templates, I find Bicep to be more user-friendly, intuitive, and concise. If you're familiar with Terraform, you'll find Azure …

Read more

Create CPU quota usage alerts for subscription using Azure ARM templates

This article is about Implementing of CPU Quota Usage Alert for Azure Subscription. As part of my recent assignment, I successfully created a CPU quota usage alert for an Azure subscription using Azure Resource Manager (ARM) templates. The deployment enables real-time monitoring of CPU quota usage, providing proactive alerts to prevent potential resource exhaustion.

Upon deployment, the alert r…

Read more

Resolved Terraform Error: POST https api.github.com user repos 401 Requires authentication

I was receiving Error: POST https://api.github.com/user/repos: 401 Requires authentication [] while applying and deploying repository on github.com with Terraform. This error occurs because terraform is not able to authenticate to GitHub.com API and not able to perform the action.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23…

Read more

GitHub repository integration with Terraform Cloud to Deploy and Manage Azure

Streamline your infrastructure as code (IaC) workflows by integrating your GitHub repository with HashiCorp Terraform Cloud (HCP). This powerful combination enables automatic execution of Terraform plans and applies based on changes made to your infrastructure code, ensuring that every update to your repository triggers the necessary Terraform actions.

In this step-by-step guide, I'll explore h…

Read more

View older posts »

Page Views

12167800

THIS! This worked, thank you so much!

Almost 1h spent troubleshooting silly windows errors...all other "tutorials" and "guides" should really just link this ste.

Thank you.

I wish I would have read this a few days ago. This fixed my issues. Much appreciated.

Where I can run this script?

Follow me on Blogarama