Skip to content

Commit 632022c

Browse files
Merge pull request #266727 from vhorne/fw-deploy-ps
update the VM section to include credentials
2 parents bea6fc8 + 6a31d3a commit 632022c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

articles/firewall/deploy-ps.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: In this article, you learn how to deploy and configure Azure Firewa
44
services: firewall
55
author: vhorne
66
ms.service: firewall
7-
ms.date: 08/02/2022
7+
ms.date: 02/20/2024
88
ms.author: victorh
99
ms.topic: how-to
1010
ms.custom: devx-track-azurepowershell
@@ -110,8 +110,10 @@ $wsn = Get-AzVirtualNetworkSubnetConfig -Name Workload-SN -VirtualNetwork $test
110110
$NIC01 = New-AzNetworkInterface -Name Srv-Work -ResourceGroupName Test-FW-RG -Location "East us" -Subnet $wsn
111111
112112
#Define the virtual machine
113+
$SecurePassword = ConvertTo-SecureString "<choose a password>" -AsPlainText -Force
114+
$Credential = New-Object System.Management.Automation.PSCredential ("<choose a user name>", $SecurePassword);
113115
$VirtualMachine = New-AzVMConfig -VMName Srv-Work -VMSize "Standard_DS2"
114-
$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName Srv-Work -ProvisionVMAgent -EnableAutoUpdate
116+
$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName Srv-Work -ProvisionVMAgent -EnableAutoUpdate -Credential $Credential
115117
$VirtualMachine = Add-AzVMNetworkInterface -VM $VirtualMachine -Id $NIC01.Id
116118
$VirtualMachine = Set-AzVMSourceImage -VM $VirtualMachine -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus '2019-Datacenter' -Version latest
117119

0 commit comments

Comments
 (0)