Sha256: b5feb248a64c5f8d34c3c6280a70a60460e59f48211e4ad9309364c1db9e0925

Contents?: true

Size: 1.08 KB

Versions: 34

Compression:

Stored size: 1.08 KB

Contents

#-------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies, Inc.
# All Rights Reserved. Licensed under the MIT License.
#--------------------------------------------------------------------------

function Get-Remote-Session($guest_ip, $username, $password) {
    $secstr = convertto-securestring -AsPlainText -Force -String $password
    $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr
    New-PSSession -ComputerName $guest_ip -Credential $cred -ErrorAction "stop"
}

function Create-Remote-Session($guest_ip, $username, $password) {
    $count = 0
    $session_error = ""
    $session = ""
    do {
        $count++
        try {
            $session = Get-Remote-Session $guest_ip $username $password
            $session_error = ""
        }
        catch {
            Start-Sleep -s 1
            $session_error = $_
            $session = ""
        }
    }
    while (!$session -and $count -lt 20)

    return  @{
        session = $session
        error = $session_error
    }
}

Version data entries

34 entries across 31 versions & 6 rubygems

Version Path
vagrant-unbundled-2.1.1.0 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-2.0.4.0 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-2.0.3.0 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-2.0.2.0 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-2.0.1.0 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-2.0.0.1 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-1.9.8.1 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-1.9.7.1 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-1.9.5.1 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-unbundled-1.9.1.1 plugins/providers/hyperv/scripts/utils/create_session.ps1
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/hyperv/scripts/utils/create_session.ps1