Sha256: 27dcb3ad9424fb50489c3d8d8f38232c9f3f8ef6e998892813e2882371e19f9f

Contents?: true

Size: 1.32 KB

Versions: 49

Compression:

Stored size: 1.32 KB

Contents

trap {
  $e = $_.Exception
  $e.InvocationInfo.ScriptName
  do {
    $e.Message
    $e = $e.InnerException
  } while ($e)
  break
}

function folder($path){
  $path | ? {-not (test-path $_)} | % {$null = mkdir $_}
}

Function Decode-Files($hash) {
  foreach ($key in $hash.keys) {
    $value = $hash[$key]
    $tzip, $dst = $Value["tmpzip"], $Value["dst"]
    if ($tzip) {Unzip-File $tzip $dst}
    New-Object psobject -Property @{dst=$dst;src_sha1=$key;tmpzip=$tzip}
  }
}

Function Unzip-File($src, $dst) {
  $unpack = $src -replace '\.zip'
  $dst_parent = Split-Path -Path $dst -Parent
  if(!(Test-Path $dst_parent)) { $dst = $dst_parent }
  folder $unpack, $dst
  try {
    try{
      [IO.Compression.ZipFile]::ExtractToDirectory($src, $unpack)
    }
    catch {
      Add-Type -AssemblyName System.IO.Compression.FileSystem -ErrorAction Stop
      [IO.Compression.ZipFile]::ExtractToDirectory($src, $unpack)
    }
  }
  catch {
    Try {
      $s = New-Object -ComObject Shell.Application
      ($s.NameSpace($unpack)).CopyHere(($s.NameSpace($src)).Items(), 0x610) | Out-Null
    }
    Finally {
      [void][Runtime.Interopservices.Marshal]::ReleaseComObject($s)
    }
  }
  dir $unpack | cp -dest "$dst/" -force -recurse
  rm $unpack -recurse -force
}

$hash_file = <%= hash_file %>
Decode-Files $hash_file | ConvertTo-Csv -NoTypeInformation

Version data entries

49 entries across 33 versions & 3 rubygems

Version Path
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/winrm-fs-1.3.5/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/winrm-fs-1.3.5/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/winrm-fs-1.3.5/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/winrm-fs-1.3.5/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/winrm-fs-1.3.5/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/winrm-fs-1.3.5/lib/winrm-fs/scripts/extract_files.ps1.erb
winrm-fs-1.3.5 lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/winrm-fs-1.3.4/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/winrm-fs-1.3.4/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/winrm-fs-1.3.3/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/winrm-fs-1.3.2/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/winrm-fs-1.3.2/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/winrm-fs-1.3.4/lib/winrm-fs/scripts/extract_files.ps1.erb
winrm-fs-1.3.4 lib/winrm-fs/scripts/extract_files.ps1.erb
winrm-fs-1.3.3 lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/winrm-fs-1.3.2/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/winrm-fs-1.3.2/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.0/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/extract_files.ps1.erb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.2/lib/winrm-fs/scripts/extract_files.ps1.erb