Installing software/running scripts on VMs #615
-
Hi, I'm looking to install and possibly run scripts on client machines during the setup phase. I'm guessing the answer is to leverage the unattend.xml file that is injected into the VHDX when the Deploy script is run. Scenario might be:
In the LabConfig.ps1 for the LabConfig.VMs there is an option for CustomPowerShellCommands. What is that intended for or what does it do? I wasn't able to find it being used in any of the example labs. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi Ogmini, The first 3 point are covered just by using the LabConfig.ps1 script by default every VM you specify in the configuration will be offline domain joined using blob unless you add 'Unattend="None"' to the VM configuration as shown below in the code snip from my LabConfig.ps1 - to specify just the DC and 2 Windows 11 VM's your config file would only contain the variables and the $LABConfig.VMs for the Client VMs
As for the forth point for installing Office there are various ways to do this, including installing Office into the Windows 11 parent VHD image, using a post install command to install office using winget or another method, of including it in the tools disk that gets created. I tend to just add any post install scripts / applications etc to the tools disk and mount that to the VMs This is my version of the LabConfig.ps1 script which you may find easier to use |
Beta Was this translation helpful? Give feedback.
Hi Ogmini,
The first 3 point are covered just by using the LabConfig.ps1 script by default every VM you specify in the configuration will be offline domain joined using blob unless you add 'Unattend="None"' to the VM configuration as shown below in the code snip from my LabConfig.ps1 - to specify just the DC and 2 Windows 11 VM's your config file would only contain the variables and the $LABConfig.VMs for the Client VMs