Sha256: 6d651587df4de6baac7264fe59951a9f1bbe17dffce2665e0cfe236abf5fa867

Contents?: true

Size: 513 Bytes

Versions: 64

Compression:

Stored size: 513 Bytes

Contents

module PSWindows::File
  include Beaker::CommandFactory

  def tmpfile(name)
    result = exec(powershell('[System.IO.Path]::GetTempFileName()'))
    result.stdout.chomp()
  end

  def tmpdir(name)
    result = exec(powershell('[System.IO.Path]::GetTempPath()'))
    result.stdout.chomp()
  end

  def path_split(paths)
    paths.split(';')
  end

  def file_exist?(path)
    result = exec(Beaker::Command.new("if exist #{path} echo true"), :acceptable_exit_codes => [0, 1])
    result.stdout =~ /true/
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
beaker-2.34.0 lib/beaker/host/pswindows/file.rb
beaker-2.33.0 lib/beaker/host/pswindows/file.rb
beaker-2.32.1 lib/beaker/host/pswindows/file.rb
beaker-2.32.0 lib/beaker/host/pswindows/file.rb