How to Pass parameters to Custom Script Extension script using ARM templates

Dnyaneshwar Surywanshi 156 Reputation points

Below is my script and I want pass parameter using ARM template while deployment of ARM template .

$disks = Get-Disk | Where partitionstyle -eq 'raw' | sort number

$letters = 'H' | ForEach-Object { [char]$_ }

$labels = "Worknew3"
$PartitionStyles = "GPT"

foreach ($disk in $disks) {
    $driveLetter = $letters
    $disk | 
    Initialize-Disk -PartitionStyle $PartitionStyles -PassThru |
    New-Partition -UseMaximumSize -DriveLetter $driveLetter |
    Format-Volume -FileSystem NTFS -NewFileSystemLabel $labels -Confirm:$false -Force

So As you can see I want to pass value for the $letters, $labels and $PartitionStyles .Can some one please give me any example or link for this.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
6,342 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,183 questions
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 16,976 Reputation points MVP

    You can find the example here.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

0 additional answers

Sort by: Most helpful