- Open the current packer log file in the
TEMP
directory, something like%TEMP%packer-log722498239
, in a text editor. - Find the string
\"osProfile\":{\"adminPassword\":\"
. There you can see your admin password, something like9RQF11ZTRL1W3YfQN3LpJ7Jib9gfkgXa
... - Figure out the public IP address of your Windows VM, for example through resources.azure.com.
- Run the following:
$address = "13.81.111.231"
$pass = "9RQF11ZTRL1W3YfQN3LpJ7Jib9gfkgXa"
$user = "packer"
$cred = New-Object System.Management.Automation.PSCredential($user, ($pass | ConvertTo-SecureString -asPlainText -Force))
$session = New-PSSession -ConnectionUri "https://$($address):5986/WSMAN" -Credential $cred -SessionOption $(New-PSSessionOption -SkipCNCheck -SkipCACheck)
Invoke-Command -Session $session -ScriptBlock { Get-ChildItem C:\ }