File tree Expand file tree Collapse file tree
examples/windows_w_run_command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,6 +292,12 @@ module "testvm" {
292292 generate_admin_password_or_ssh_key = false
293293 }
294294 }
295+ additional_unattend_contents = [
296+ {
297+ setting = "FirstLogonCommands"
298+ content = "<FirstLogonCommands><SynchronousCommand><CommandLine>%windir%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoProfile -ExecutionPolicy Bypass -file C:\\test.ps1</CommandLine><Description>script</Description><Order>2</Order></SynchronousCommand></FirstLogonCommands>"
299+ }
300+ ]
295301 enable_telemetry = var.enable_telemetry
296302 encryption_at_host_enabled = true
297303 managed_identities = {
Original file line number Diff line number Diff line change @@ -273,6 +273,12 @@ module "testvm" {
273273 generate_admin_password_or_ssh_key = false
274274 }
275275 }
276+ additional_unattend_contents = [
277+ {
278+ setting = " FirstLogonCommands"
279+ content = " <FirstLogonCommands><SynchronousCommand><CommandLine>%windir%\\ System32\\ WindowsPowerShell\\ v1.0\\ powershell.exe -NoProfile -ExecutionPolicy Bypass -file C:\\ test.ps1</CommandLine><Description>script</Description><Order>2</Order></SynchronousCommand></FirstLogonCommands>"
280+ }
281+ ]
276282 enable_telemetry = var. enable_telemetry
277283 encryption_at_host_enabled = true
278284 managed_identities = {
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ resource "azurerm_windows_virtual_machine" "this" {
7474 }
7575 dynamic "additional_unattend_content" {
7676 for_each = {
77- for content in var . additional_unattend_contents : sha256 (content) => content
77+ for content in var . additional_unattend_contents : sha256 (content. content ) => content
7878 }
7979
8080 content {
You can’t perform that action at this time.
0 commit comments