PowerShell script to enable Trusted Launch security features on Azure VMs.
- Azure PowerShell module installed
- Appropriate Azure permissions
- VMs must be in a stopped state during the upgrade
- Single VM:
$resourceGroup = "your-resource-group"
$vmName = "your-vm-name"
- All VMs in resource group (uncomment relevant sections):
$resourceGroup = "your-resource-group"
$vms = Get-AzVM -ResourceGroupName $resourceGroup
- Enables Trusted Launch security type
- Configures Secure Boot
- Enables vTPM
- Validates security settings post-upgrade
- Handles VM stop/start automatically
Ensure your VMs meet the requirements for Trusted Launch before running the script.