Add variable value to HashTable as key
Powershell V5 Windows 10
For example, a variable $EmployeeID
contains a string testValue
, I just want to use the value of the previous variable inside the function $HastTable.Add()
. It will look like this:
$HashTable.Add($EmployeeID, 'some_value')
Other than that it won't work, but hopefully I understand what I want to achieve.
With this, I can access the value as usual:
$var = $HashTable.testValue
Simple question and I'm sure I'm missing something obvious, but I've tried searching the web and I couldn't find anything.
+3
source to share