This file contains hidden or 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 | |
Removes status files with indexes greater than the highest index found in the settings directory. | |
.DESCRIPTION | |
This script automatically finds the latest versioned extension directory for the WindowsPatchExtension, | |
identifies the highest-numbered `.settings` file under the `RuntimeSettings` directory, and deletes all | |
`.status` files under the corresponding `status` directory that have a higher numeric index. | |
.PARAMETER None |
This file contains hidden or 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
resources | |
| where type == "microsoft.hybridcompute/machines" | |
| extend | |
ArcAgentVersion = tostring(properties.agentVersion), | |
OSVersion = tostring(properties.osSku), | |
MachineName = tostring(properties.machineFqdn), | |
Status = tostring(properties.status), | |
LastStatusChangeRaw = todatetime(properties.lastStatusChange), | |
LastStatusChangeUTC = format_datetime(todatetime(properties.lastStatusChange), 'yyyy-MM-dd HH:mm:ss'), | |
Provider = tostring(properties['cloudMetadata']['provider']) |
This file contains hidden or 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 | |
Assigns specified Azure roles to a user or managed identity across multiple subscriptions. | |
.DESCRIPTION | |
This script reads subscription IDs from a JSON file and assigns predefined roles at the subscription scope | |
to a specified principal (user or managed identity). It handles Azure authentication, validates role existence, | |
checks for existing assignments to avoid duplication, and outputs clear processing results. | |
The script is designed for environments requiring consistent role assignments across multiple Azure subscriptions. |
This file contains hidden or 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 | |
Triggers an on-demand backup for one or more Azure VMs using Recovery Services Vault. | |
.DESCRIPTION | |
This script connects to Azure using a system-assigned managed identity (MSI) and loops through one or more VMs | |
to identify their registered backup container and trigger an on-demand backup job. It provides formatted and | |
timestamped console output and handles common errors such as concurrent backup operations. | |
.PARAMETER SubscriptionId |
This file contains hidden or 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 PowerShell script migrates runbooks, variables, schedules, modules, certificates, connections, credentials, webhooks, private endpoints, and their tags across tenants. | |
.DESCRIPTION | |
This PowerShell script is designed to migrate runbooks, variables, schedules, modules, certificates, connections, credentials, webhooks, private endpoints, and their tags across tenants. All PS 5 and PS 7 runbooks will be imported as PS 5 runtime; you can change it via the runtime environment later. | |
.PARAMETER oldSubscriptionId | |
Required. Source subscription of the Azure Automation account. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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'. |
NewerOlder