I have a CloudBase-Init that includes the following line of PowerShell:
Get-Disk | Where-Object PartitionStyle -Eq "RAW" | Initialize-Disk -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -NewFileSystemLabel "DATA" -FileSystem NTFS -Force
During deployment autologon logs in and I see the following pop-up:
Title: Microsoft Windows
Body:
You need to format the disk in drive E: before you can use it.
Do you want to format it?
[Format disk] [Cancel]
When installing CloudBase-Init I specified that it should run as system. In the same code block as above I output whoami /all to a text file and can confirm that the username is nt authority\system
. If I run the above PowerShell after deployment as local Admin I don't get any pop-up or prompts -- it just executes.
How do I fix this?