Method: PSWindows::Exec#mkdir_p

Defined in:
lib/beaker/host/pswindows/exec.rb

#mkdir_p(dir) ⇒ Boolean

Create the provided directory structure on the host

Parameters:

  • dir (String)

    The directory structure to create on the host

Returns:

  • (Boolean)

    True, if directory construction succeeded, otherwise False



104
105
106
107
108
109
# File 'lib/beaker/host/pswindows/exec.rb', line 104

def mkdir_p dir
  normalized_path = dir.tr('/', '\\')
  result = exec(powershell("New-Item -Path '#{normalized_path}' -ItemType 'directory'"),
                :acceptable_exit_codes => [0, 1])
  result.exit_code == 0
end