

{"id":672,"date":"2017-10-20T09:55:26","date_gmt":"2017-10-19T23:55:26","guid":{"rendered":"https:\/\/kng.tech\/blog\/?p=672"},"modified":"2017-10-20T10:01:19","modified_gmt":"2017-10-20T00:01:19","slug":"powershell-using-xml-as-config-file","status":"publish","type":"post","link":"https:\/\/kng.tech\/blog\/powershell-using-xml-as-config-file\/","title":{"rendered":"Powershell - Using XML as config file"},"content":{"rendered":"<p>It is extremely easy to use xml as a config file:<\/p>\n<p>To load values from XML,<br \/>\nFor example:<\/p>\n<p>Settings.xml:<\/p>\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;DefaultValues&gt;\r\n &lt;Version&gt;22.09.2017.2&lt;\/Version&gt;\r\n&lt;\/DefaultValues&gt;\r\n<\/pre>\n<p><\/code><\/p>\n<pre><code>\r\n[xml]$Settings = Get-Content \"pathto\\Settings.xml\"\r\n$version = $Settings.DefaultValues.Version\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is extremely easy to use xml as a config file: To load values from XML, For example: Settings.xml: &lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; &lt;DefaultValues&gt; &lt;Version&gt;22.09.2017.2&lt;\/Version&gt; &lt;\/DefaultValues&gt; [xml]$Settings = Get-Content \"pathto\\Settings.xml\" $version = $Settings.DefaultValues.Version &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[43,77],"class_list":["post-672","post","type-post","status-publish","format-standard","hentry","category-tech","tag-powershell","tag-xml"],"_links":{"self":[{"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/posts\/672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/comments?post=672"}],"version-history":[{"count":6,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/posts\/672\/revisions"}],"predecessor-version":[{"id":678,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/posts\/672\/revisions\/678"}],"wp:attachment":[{"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/media?parent=672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/categories?post=672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kng.tech\/blog\/wp-json\/wp\/v2\/tags?post=672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}