I wish to read the below xml values for a given key in a secure encrypted manner using powershell.
So, for example, a given key port
it should print the value 8814
Likewise for app_name
it should print Signup-qa
<?xml version="1.0" standalone="true"?>
<parameters>
<setParameter value="Signup-qa" name="app_name"/>
<setParameter value="8814" name="port"/>
<setParameter value="true" name="debug"/>
</parameters>
I tried the below but I get error.
C:\WINDOWS\system32>powershell # [xml]$xml=Get-Content C:\AMD\setparam.xml
C:\WINDOWS\system32>powershell $xml.SelectSingleNode('//entry[@name="app_name"]').Value
You cannot call a method on a null-valued expression.
At line:1 char:1
+ $xml.SelectSingleNode('//entry[@name=app_name]').Value
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Also, wanted to know if this is a secure way [encrypted] to read the key-value?
I will eventually take this to a github actions workflow.