File: get_env.ps1

package info (click to toggle)
ruby-childprocess 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: ruby: 1,285; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 322 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
param($p1)
$env_list = Get-ChildItem Env:

# Builds a ruby hash compatible string
$hash_string = "{"

foreach ($item in $env_list)
{
  $hash_string  += "`"" + $item.Name + "`" => `"" + $item.value.replace('\','\\').replace('"','\"') + "`","
}
$hash_string += "}"

$hash_string | out-File -Encoding "UTF8" $p1