At first glance, as in the below shared PowerShell script looks like a simple set of nested foreach loops printing numbers. But it has very powerful - and always overlooked - control structure: calledLoop Label.
When you’re running PowerShell scripts as scheduled tasks, background jobs, Runspace jobs, or on remote servers, normal Write-Host or Write-Debug output often disappears. That’s where System.Diagnostics.Trace comes in.
System.Diagnostics.Trace is a built-in.NET class designed to instrument, monit…
While working with VMware Tools, I needed to audit exactly which features/components were installed on a VM. VMware Tools isn’t just one package — it installs several sub-features like drivers, services, and utilities. I wanted a clean report showing each component and whether it was actually instal…
When writing long-running PowerShell scripts, displaying real-time feedback keeps users engaged and reassures them that the script hasn't frozen. However, flooding the console with hundreds of lines of text makes it unreadable, and using Clear-Host causes an annoying screen flicker.
This script focuses on automating the audit of Active Directory and LDAP settings across multiple generations of HPE iLO using PowerShell and the Redfish API. Before running the script First you will need to create a CSV file with HPE Generation, IP, username and password information as shown in the…
In this series to access nested ESXi lab I need a Jump Server, which I will setup one using this PowerCLI script, Below is the output for it. This Jump server Windows VM is deployed using existing template. It is customized using specs, IP assigned, Added two network adapters one in LAN and another …
This article will focus configuring VLANs in my VMware ESXi home lab. Before creating nested ESXi servers I wanted real VLANs to be used for NSX-T lab. For VLANs inside nested ESXi I can easily achieve it using VyOS virtual router virtual machines. [There are other VyOS virtual routers alternatives …
While building nested VMware virtualization lab, I wanted to use VLANs in the nested ESXi networking. In my lab I have only single physical ESXi server. For nested ESXi VM, passing VLAN directly from physical network was not an option for me due to limited access to physical switch and router. To ta…
In this article I will explore how to SCP to vCenter Server Appliance (VCSA). In the first approach I tried simple scp command to transfer file to or from vCenter Server. After running command I was receiving below error.
Note : Make sure SSH shell is enabled on VMware vCenter Server.
One of my friend asked for a PowerShell script for Nutanix Windows virtual machine cloning and configuration. This PowerShell script automates the process of cloning virtual machines and joining them to a domain. It uses the Nutanix PowerShell module to interact with the Nutanix cluster and clone vi…
I day to day work in my Lab. While working on my Linux / VMware / vSphere lab I always encounter frequent password resets, password not accepted because of dictionary check and old password history. Whenever I want to do quick labs. password resets take enormous time, for this reason I use below set…
In this article, I demonstrate how to test network connectivity for a list of computer names or IP addresses using PowerShell. Each target system is tested for ICMP reachability (ping) and TCP connectivity on port 445, which is commonly used for SMB.
I will explore Enter-AzVM cmdlet in this blog article which is a part of az.ssh module and establishes a connection over SSH port 22. In this article I will show how to setup windows server to accept SSH connection. Before you start, make sure you've using below commands.:
In this article I will explore running commands remotely on Azure VM without login and this doesn't require full RDP session. This is very useful feature if some information need to fetched or any configuration need to be done without much efforts. If you check on Azure portal navigate to Virtual Ma…
Enumeration is the action of mentioning a number of things one by one, often to count them or describe them but it has specific meanings in computer science, data types like enum for named constants.
In the PowerShell to list the enumeration information for a parameter, you will need to use elem…
This simple PowerShell script clones Nutanix Linux virtual machines. To use this script, first download and install the PowerShell cmdlets from Nutanix Prism Central. You can find the installed plugin folder under C:\Program Files(x86)\Nutanix folder. From there you can load plugins.
I recently received a task to rename a bunch of files by changing their numbering in the filename while working on a PowerShell DevOps project. I had multiple Markdown files with numbers at the start of their names, and I needed to change these numbers with the filename based on a mentioned in CSV f…
This article dives into the Test-TcpPort function, a compact script that resolves hostnames to IPs, pings for basic reachability, and tests port connectivity with a timeout. I will break down its mechanics in short. At its core, Test-TcpPort leverages .NET's System.Net and System.Net.Sockets namespa…
In this article, I will explore two PowerShell scripts that test network connectivity (Ping) and port availability (Port Query) on multiple computers. I will discuss the scripts, their differences, and how to use them effectively. First Script is used for Synchronous Network Testing. The first scrip…
I had a requirement to reset some user password on Linux remotely, below is the simple script which helps to reset password locally, it uses simple passwd command. Save below file as reset_password.sh.