# Now provision files in the order they are specifiedĬonfig.vm.provision "shell", inline: "path/to/temporary/location/powershellfile. # Rinse/repeat for additional provisioning files I don't recommend doing it this way except that it has the advantage of not. This is kind of a hack as it looks like plug-in, but really isn't (it won't show up when you do vagrant plugin list). # Load up the files to the Guest environment for use by PowerShellĬonfig.vm.provision "file", source: "path/to/provisioning/files/powershellfile.ps1", destination: "path/to/temporary/location/powershellfile.ps1" config.vm.provision 'list-files', type: 'localshell', command: 'ls' And via the command line like this: vagrant provision -provision-with list-files. Then, configure your Vagrantfile to automount a sharedfolder, copy over PowerShell scripts, and then run them in the order specified. New-Item -ItemType Directory -Force -Path "path\to\folder\on\vm"Ĭopy-Item "\\VBOXSRV\\path\to\folder\to\copy\*" -Destination "path\to\folder\on\vm" -recurse Write-Host "Folder 'path\to\folder\on\vm' already exists." #Check if the directory you're copying already exists on the VM In this case, Vagrant will set the ANSIBLE_CONFIG environment variable accordingly.This is a little old but I'll throw another answer in here for entire directory structures for Windows users using PowerShell.įirst, create a Powershell script that copies over an entire folder structure from a shared folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |