How to install windows Sandbox with PowerShell
Windows Sandbox provides a lightweight desktop environment to safely run applications in isolation. Software installed inside the Windows Sandbox environment remains "sandboxed" and runs separately from the host machine.
A sandbox is temporary. When it's closed, all the software and files and the state are deleted. You get a brand-new instance of the sandbox every time you open the application. Note, however, that as of Windows 11 Build 22509, your data will persist through a restart initiated from inside the virtualized environment useful for installing applications that require the OS to reboot.
Software and applications installed on the host aren't directly available in the sandbox. If you need specific applications available inside the Windows Sandbox environment, they must be explicitly installed within the environment.
Sources : https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-overview
Script presentation
Script Source : Github
My script is divided into two parts :
- Prerequisites check, this step verifies that the computer has everything needed to install and run Windows Sandbox
- If you used a virtual machine, the script send alert for activate nested virtualization
- Install Windows Sandbox, this step install Windows Sandbox on your computer
- This step require a restart computer after feature installation