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

Dnyaneshwar Surywanshi 156 Reputation points
2021-02-11T11:40:17.52+00:00

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.
7,158 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,381 questions
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 21,336 Reputation points MVP
    2021-02-11T12:55:38.76+00:00

    Hi,
    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