Sha256: e403dcc55c573808f0c85a0f8d3770817ca7df86df7c24070d10be17cc1b9e3d
Contents?: true
Size: 601 Bytes
Versions: 32
Compression:
Stored size: 601 Bytes
Contents
module VagrantPlugins module CommunicatorWinRM module CommandFilters # Converts a *nix 'which' command to a PowerShell equivalent class Which def filter(command) executable = command.strip.split(/\s+/)[1] return <<-EOH $command = [Array](Get-Command #{executable} -errorAction SilentlyContinue) if ($null -eq $command) { exit 1 } write-host $command[0].Definition exit 0 EOH end def accept?(command) command.start_with?('which ') end end end end end
Version data entries
32 entries across 29 versions & 6 rubygems