次のXMLファイルがあり、baseAddressの値を出力してから値を変更し、同じXMLファイルに更新を書きたいと思います。C#とPowerShellのXPATHの問題
私の問題は、PowerShellで次のスクリプトを使用して操作していて、関連する値を取得できないようです。理由は、サインがあるかもしれないと思う。 '要素名 "system.serviceModel"で、PowerShellはsystemの下にあるserviceModelサブ要素を取得したいと思いますか?任意のアイデアbaseAddressの正しい値を取得する方法?事前に
$FooConfig = [xml](get-content .\Foo.exe.config -ErrorAction:stop)
FooConfig.configuration.system.serviceModel.services.service.host.baseAddress
<configuration>
<system.serviceModel>
<services>
<service name="FooImpl" behaviorConfiguration="mexServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:9090/Foo" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
おかげで、 ジョージ
こんにちは、ジョージ、 PowerShellのどのバージョン? –
1.0、任意のアイデア? – George2