This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script retrieves dependency information for specified Python modules and versions from PyPI. | |
.DESCRIPTION | |
The `Get-PythonModuleDependencies` function fetches dependency details for multiple specified Python modules and versions by accessing the PyPI JSON metadata. The dependencies, if any, are displayed in a structured table format, showing the module name, operator, version, and any conditions. Additionally, the script outputs information about each main module and version being checked, along with URLs for the PyPI project and JSON metadata. | |
.PARAMETER ModuleNames | |
An array of Python module names to check for dependencies. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Provides advanced console output functionality with customizable timestamps and colorization options. | |
.DESCRIPTION | |
This script contains the `Write-Console` function to enhance PowerShell console output. | |
It offers features such as customizable timestamps, colored text, and segmented messages with advanced formatting. | |
A "Rainbow" mode is included, which applies unique colors to each character, improving readability and visual organization. | |
.EXAMPLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script converts non-encrypted Automation Account variables to encrypted ones. | |
.DESCRIPTION | |
The script retrieves all variables from an Azure Automation Account and checks if they are encrypted. If any variables are not encrypted, it removes and re-creates the variable with encryption enabled. It outputs the status of each variable during the process. | |
.PARAMETER ResourceGroupName | |
The name of the Azure Resource Group containing the Automation Account. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script gathers Azure quota and usage data for various services like Virtual Machines, Managed Disks, Storage, Networking, etc., for a specified region and outputs the data. | |
Optionally, it exports the data to a CSV file. | |
.DESCRIPTION | |
The script connects to your Azure subscription and retrieves usage and quota information for multiple services such as Virtual Machines, Managed Disks, Storage, and Networking. | |
It sorts the data by usage percentage and displays it in a formatted table. If needed, the data can also be exported to a CSV file. | |
.PARAMETER Location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script manages Azure VMs during maintenance events by stopping and starting services based on the specified mode. | |
.DESCRIPTION | |
The script processes webhook data to determine the maintenance event type and manages Azure VMs accordingly. It stops services in 'pre' mode and starts them in 'post' mode. | |
.PARAMETER ScriptMode | |
Specifies the mode of the script. Valid values are 'Pre' and 'Post'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Copyright (c) Microsoft Corporation. | |
# | |
# This script will | |
# 1. Configure host machine to download from packages.microsoft.com | |
# 2. Install Azcmagent package | |
# 3. Configure for proxy operation (if specified on the command line) | |
# | |
# Note that this script is for Linux only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script lists all virtual machines in each Azure subscription and displays their public IP addresses. | |
.DESCRIPTION | |
The script authenticates using Managed Identity, sets the context to a specified tenant, retrieves all subscriptions | |
in that tenant, and then lists all virtual machines in each subscription along with their public IP addresses if available. | |
.NOTES | |
Ensure that the Managed Identity has sufficient permissions to access subscriptions and resources. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Identifies the required modules for a given PowerShell script by analyzing the cmdlets used within the script. | |
.DESCRIPTION | |
The Get-RequiredModules function takes a script as input, extracts all the cmdlets used in the script, and determines which modules | |
these cmdlets belong to. It then returns a unique list of required modules. | |
.PARAMETER Script | |
The content of the PowerShell script to analyze for required modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script retrieves maintenance configurations and the count of VMs associated with each configuration | |
# The script uses the Azure Maintenance and Azure Resource Graph modules | |
# Author: Blake Drumm ([email protected]) | |
# Date created: May 20th, 2024 | |
# Original location: https://gist.github.com/blakedrumm/70abcf47d0e788d91a7f277d4590f122 | |
# Import the required module | |
Import-Module Az.Maintenance | |
Import-Module Az.ResourceGraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create-MaintenanceConfigManagerRole.ps1 | |
# Script to create a custom role for managing Azure Maintenance Configurations | |
# Author: Blake Drumm ([email protected]) | |
# Website: https://blakedrumm.com/blog/resolve-azure-maintenance-configuration-error/ | |
# Date created: May 15th, 2024 | |
# Date modified: May 15th, 2024 | |
# Define custom variables | |
$subscriptionId = "a1b2c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p" | |
$resourceGroupName = "ResourceGroupName" |
NewerOlder