PoshCode Archive  Artifact [600dec840e]

Artifact 600dec840eee0df5a00b5370c8ff0073016e7e2e2b447904a7ab363c4a5748a2:

  • File whitebox.ps1 — part of check-in [83a39917cd] at 2018-06-10 14:15:43 on branch trunk — It gets the System Environment Variables from Registry (user: BSonPosh size: 617)

# encoding: ascii
# api: powershell
# title: whitebox
# description: It gets the System Environment Variables from Registry
# version: 0.1
# author: BSonPosh
# license: CC0
# x-poshcode-id: 6437
# x-archived: 2016-10-15T17:06:42
# x-published: 2016-07-01T11:32:00
#
#
Param($srv=$env:ComputerName)
$regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,$Srv)
$key = $regKey.OpenSubkey("SYSTEM\CurrentControlSet\Control\Session Manager\Environment",$false)
$key.GetValueNames() | Select-Object @{n="ValueName";e={$_}},@{n="Value";e={$key.GetValue($_)}}