have corrected the 10th line to be:
ps5.powershell_elevated_interactive = true
same result.
On Saturday, 24 March 2018 14:12:53 UTC+13, kewalaka wrote:
>
> When using a provisioner in a Vagrantfile - I can't see where $username is
> being being passed in, the error I'm seeing is:
>
>
> DEBUG winrmshell: [WinRM] Processing output
>> INFO interface: detail: Exception calling "RegisterTaskDefinition" with
>> "7" argument(s): "(10,8):UserId:"
>> At line:72 char:1
>> + $folder.RegisterTaskDefinition($task_name, $task, 6, $username,
>> $pass_to_use, $l ...
>> +
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> + CategoryInfo : NotSpecified: (:) [],
>> MethodInvocationException
>> + FullyQualifiedErrorId : ComMethodTargetInvocation
>
>
>
> If I interactively run the script from the DEBUG output, I get the same
> problem, if I first set $username, it works fine.
>
> The VagrantFile I'm using is below, the username and password is the
> default (vagrant/vagrant). As you can see, I've tried to specify the winrm
> username too, though this should not be necessary:
>
> # Machine parameters
> nodes = [
> { :hostname => 'LABSQL01', :box => 'windows2012r2', :cpus => '2',
> :maxmemory => '4096'}
> ]
> vSwitch = "vExternal"
>
> def provision_chocolatey(config)
> config.vm.provision "shell" do |ps5|
> ps5.inline = "iex ((new-object net.webclient).DownloadString('
> https://chocolatey.org/install.ps1'))"
> powershell_elevated_interactive = true
> end
> end
>
> # Vagrant configuration (file format v2)
> #
> Vagrant.configure("2") do |config|
>
> config.winrm.username = "vagrant"
>
> nodes.each do |node|
> # machine to base off
> config.vm.box = node[:box]
>
> # disabled shared folders
> config.vm.synced_folder ".", "/vagrant", disabled: true
>
> # set the vSwitch to use
> config.vm.network "public_network", bridge: "vExternal"
>
> # hyper-v specifics, see
> https://www.vagrantup.com/docs/hyperv/configuration.html
> config.vm.provider "hyperv" do |h|
> h.vmname = node[:hostname]
> h.cpus = node[:cpus]
> # maxmemory is the maximum allowed via dynamic allocation
> h.maxmemory = node[:maxmemory]
> h.differencing_disk = true
> h.auto_start_action = "Nothing"
> h.auto_stop_action = "TurnOff"
> h.ip_address_timeout = 600
> end
>
> provision_chocolatey(config)
> end
>
> end
>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/b985bbb1-b780-4809-95ae-34c29b643491%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.