Forum Discussion
techhondo
Apr 21, 2025Copper Contributor
Gui to deploy folder contents to multiple VMs
I am trying to improve imaging computers where I work. I need to create a gui for new hires since the imaging process is so complicated. I need the GUI to request necessary computer names that are be...
Charlie34000
Jun 05, 2026MCT
Hi,
If you want to deploy the contents of a folder to multiple VMs, you don’t need much logic inside the GUI itself — the important part is the copy loop.
In your script you already define a $computers array:
$computers = @("Computer1","Computer2","Computer3")
You can then use a simple pipeline to copy the folder to each machine:
$sourceFolder = "C:\FolderToDeploy"
$computers = @("Computer1","Computer2","Computer3")
$computers | ForEach-Object {
$destinationFolder = "\\$_\C$\Path\To\DestinationFolder"
Copy-Item -Path $sourceFolder -Destination $destinationFolder -Recurse -Force
}
If you want to trigger this from your WinForms GUI, you can keep the same logic inside the button click event:
$submitButton.Add_Click({
$computers = $computersTextBox.Text -split ","
$source = $fileTextBox.Text
$computers | ForEach-Object {
$destination = "\\$_\C$\Path\To\DestinationFolder"
Copy-Item -Path $source -Destination $destination -Recurse -Force
}
})
Let me know if you want a full GUI example (WinForms or WPF) or a version using PowerShell Remoting instead of SMB.