Access External Value Store from PowerShell Script
A PowerShell connector script can access the external value store through its $components object. Use GetExternalValue when the key is required:
PowerShell
$value = $components.GetExternalValue("keyName").Value;Use TryGetExternalValue when a value is optional or the script should handle a missing key:
PowerShell
$externalValue = $null
if ($components.TryGetExternalValue("keyName", [ref]$externalValue)) {
$value = $externalValue.Value
} else {
$value = "fallback"
}These methods work in both in-process and out-of-process PowerShell execution.