Hello,
i have a powershell script which creates muliple VMs (see below)
my question is:
which powershell command should i add to the script below in order to run setup file (exe) on each machine?
e.g: i created 20 VMs and now i want to run setup file (exe) on each of these VMs after they created (20 exe file to execute)
Thanks in advance.
[int]$VMcount =Read-host “InputNumber of VMs” $Templatename =Read-host "Input VMTemplate Name" $VMTemplate =Get-SCVMTemplate|where{$_.Name-eq "$Templatename"} $VMName =Read-host “InputBaseName” $Hostname =Read-host "Input Host Name" $VMHost =Get-SCVMHost-ComputerName $Hostname $VMPath =Read-host "Input VM Path (example: C:\Clusterstorage\Volume1)" $Total =1While($total -le $VMCount){$NewVMName =“$VMName-”+ $totalWrite-Output $virtualMachineConfigurationNew-SCVirtualMachine-Name $NewVMName -VMHost"$VMHost"-path "$VMPath"-VMTemplate"$VMTemplate"-ReturnImmediately-DelayStartSeconds“0" $Total++ }