This is very handy and useful PowerCLI script, when I do my labs or production deployment changes on VMware environment. Whenever I have multiple servers to make changes and wants to ensure no problem should occur after changes, I take temporary VMware snapshots. But working with snapshot manually i…
Blog posts : "powershell"
Quickstart How to authenticate Ansible with Microsoft Azure
This article is first part of Deploy create Virtual Network vNET in Azure cloud using Ansible Here I am going to show multiple ways to authenticate Ansible with Microsoft Azure cloud. Very first method is very simple using azure az cli. Make sure you have installed azure cli application on linux wh…
Create a Azure Virtual Network with Subnet using PowerShell
Azure VNet (Virtual Network) is the essential element for your private network in the Azure Cloud. Virtual Network allows various kinds of Azure resources, such as Azure Virtual Machines (VM), to securely connect with each other, the internet, and on-premises networks. In this article I will be crea…
Azure PowerShell Get-AzStorageShare Could not get the storage context
While working with Azure Storage Account Shares report, while running below Azure az PowerShell command to get shares list, it was throwing error.
Get-AzStorageShare -Name testbackup
Get-AzStorageShare: could not get the storage context. Please pass in a storage context or set the current stor…
VMware.PowerCLI install update error - Install-Package: Authenticode issuer
I had a project to automate and upgrade VMware infrastructure. I had given few of the basic tasks to my fellow juniors to update VMware.PowerCLI modules on few servers and run script on the systems. But while upgrading VMware PowerCLI they were receiving below errors.
PackageManagement\In…
Building basic simple Web Server using PowerShell
While writing few solutions for html code I wanted to test basic html web pages, which I required to check with web server, here PowerShell can be handy to create simple and basic web server to serve html web page for testing purpose.
Download this code basic_webserver_httplistener.ps1 here…
Gather Azure Virtual Network inventory information using PowerShell
I am huge fan of PowerShell when gathering inventory report information. Before disabling few of my subscriptions in my Azure accounts, I wanted to gather Virtual Network inventory in the CSV file so It can be used later to see the information quickly to share in table format. Below is the screensho…
Microsoft Azure PowerShell cmdlet 'this.Client.SubscriptionId' cannot be null
While working on one of my expired and disabled Microsoft Azure subscription with PowerShell, I was receiving error (Get-AzVirtualNetwork: 'this.Client.SubscriptionId' cannot be null) when trying to get information from Azure Virtual Network. Although I was receiving error for all the resources when…
Powershell PSStyle Animation ANSI FileInfo color support for ANSI escape sequences | ASCII Art
Microsoft has released a new version of PowerShell 7.2. After installation of latest Microsoft PowerShell I was reading release notes and what's new document on https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-72?view=powershell-7.2. While reading, there is a…
Resolved PowerShell Visual studio code stuck with 'Starting up PowerShell' in status bar
On one of the my colleagues new laptop we were setting up Visual Studio Code environment. After installing Microsoft PowerShell extension on VSCode when executing PowerShell ps1 script, it was getting stuck/freeze/hang with message "Starting up PowerShell" at the bottom-right side, and it was showin…
Resovled issue with PowerShell - Trust relationship Rejoin computers in domain without restart
While working with The trust relationship between this workstation and the primary domain failed issue on Windows Servers, I used PowerShell cmdlet Test-ComputerSecureChannel and cmd command netdom to resolve the broken AD computer account trust relationship without reboot. Apart from these com…
PowerShell fix repair The trust relationship between this workstation and the primary domain failed
This is the issue I have always seen with Windows Server Administrator. They face below issue a lot in their day to day activities while logging with their domain account. When they login with local account it was successful. The cause of this issue is simple, whenever computer joins into domain the…
PowerShell save export data to XML file
I wanted to create XML file using PowerShell and PowerShell offers different ways to create XML file in different formats, with PowerShell you can create and generate different types of XML format. One of the simple way I shown in this article PowerShell Create XML document with XmlWriter .net obj…
PowerShell Create XML document with XmlWriter .net object
XML stands for eXtensible Markup Language it was designed to store and transport data and to be both human- and machine-readable. I wanted to create a simple readable XML files using PowerShell for few of the projects. There are native cmdlets (Export-CliXML and ConvertTo-XML) available in the Po…
Powershell Create new file if not exist, if exist Rename file
This small PowerShell script helps to create a new file inside the folder if file does not exist, if file exists rename it with the date and times. This logic I always use in my scripts when I want to implement logs system for my script. When the file is renamed (While creating new file) it adds dat…
PowerShell XML OperationStopped: No coercion operator is defined between types 'System.Object&' and 'System.Object'
While working with XML files using Powershell, I imported XML file and started exploring data inside XML. On the left hand side I have opened XML file in notepad. XML has nested objects. While accessing the nested data (Address) inside XML table I was receiving error OperationStopped: No coercion o…
PowerShell Encode or Decode an WebURL
While working few web scrapping project, I was able to get the table data, but few of the data had few special characters in the table, which was in http encoded format. Related article is a Powershell web scrapping extract table from html. The encoded http data was not readable. This data can be …
PowerShell convert string to base64 value
Base-64 encoding is a way of taking binary data and turning it into text so that it's more easily transmitted in things like e-mail and HTML form data. I had few requirement to convert / encode text string to Base64 string and vice versa, From encoded Base64 string to convert/decode to normal string…
Create an interactive HTML report with PowerShell data
Basically I wrote this project as an fun/poc, but it went very well. I wanted to show the HTML + PowerShell capabilities to my (Asset collection team) colleagues as there are endless possibilities what you can build using HTML + Powershell. After launching the html file in the chromium browser the w…
Resolved - Install RSAT Tools on Windows Installer encountered an error 0x8024001d
While working on few Active Directory automation tasks I wanted RSAT tools to be installed on one of the VDI to test and write few scripts. From https://www.microsoft.com/en-in/download/details.aspx?id=45520 I downloaded installation files.
While installation I was keep receiving this error…
Blog Search
Page Views
12386324
Archive
- December 2024 (1)
- November 2024 (2)
- October 2024 (7)
- September 2024 (12)
- August 2024 (22)
- July 2024 (11)
- June 2024 (1)
- May 2024 (3)
- April 2024 (5)
- November 2023 (1)
Comments
-
DanDecember 22, 2024 10:49PM
-
ChriSDecember 1, 2024 05:27PM
-
GoranshOctober 19, 2024 10:32AM
-
NeoModJuly 30, 2024 11:14PM
-
RogerJuly 22, 2024 10:13PM