Run it on its own to preview the plan for another kind of box:
powershell -File .\setup-windows-plan.ps1 -WhatIf -HostArch ARM64 -Elevation NOLUA
+ powershell -File .\setup-windows-plan.ps1 -WhatIf -VirtualMachine Hyper-V
The steps, and where each one is unavailable and why, come from
setup-windows-steps.ps1; this script only presents them and records the
# here the same way when this script is run on its own.
[string] $HostArch,
[ValidateSet('ALREADY', 'PROMPT', 'NOLUA')] [string] $Elevation,
+ # The hypervisor this Windows is a guest of, or 'none' for physical
+ # hardware. Detected when not given; setup-windows.bat leaves it to that.
+ [string] $VirtualMachine,
[string] $OutFile
)
Write-Host ''
Write-Host 'Setup plan - nothing has been done yet' -ForegroundColor Cyan
Write-Host " host: $ArchLabel"
+ Write-Host " machine: $VmLabel"
Write-Host " elevation: $ElevLabel"
foreach ($g in $groups.Keys) {
$head = " $g $($groups[$g])"
}
}
+# A guest VM is not somewhere to put a hypervisor of its own: VirtualBox, for
+# one, is for the test VMs, which belong on the physical host. Detected once
+# here; the steps that care are -NotInVM in setup-windows-steps.ps1.
+if (-not $VirtualMachine) { $VirtualMachine = Get-SetupVirtualMachine }
+if ($VirtualMachine -eq 'none') { $VirtualMachine = $null }
+$VmLabel = if ($VirtualMachine) {
+ "virtual machine ($VirtualMachine) - steps meant for the physical host are marked [-]"
+} else {
+ 'physical hardware'
+}
+
$ArchLabel = switch ($HostArch) {
'ARM64' { 'ARM64 - the lean build box, one C/C++ compiler; x64-only steps are marked [-]' }
'AMD64' { 'x64 - the full workstation' }
try {
$plan = @(Resolve-SetupSelection -Steps (Get-SetupCatalog -IsArm64 $IsArm64) `
-Only $(if ($onlyGiven) { $Only } else { $null }) -Skip $Skip `
- -IsArm64 $IsArm64 -Elevation $Elevation)
+ -IsArm64 $IsArm64 -Elevation $Elevation -VirtualMachine $VirtualMachine)
} catch {
# A mistyped -Only / -Skip. Said plainly, and no hand-off file, so the batch
# file stops before doing anything.