{"id":2512,"date":"2018-04-25T18:03:27","date_gmt":"2018-04-25T16:03:27","guid":{"rendered":"http:\/\/www.mariotti.de\/?p=2512"},"modified":"2018-04-25T18:03:27","modified_gmt":"2018-04-25T16:03:27","slug":"umgebungs-und-powershell-variablen-aufloesen","status":"publish","type":"post","link":"https:\/\/dev.mariotti.de\/?p=2512","title":{"rendered":"Umgebungs- und PowerShell Variablen aufl\u00f6sen"},"content":{"rendered":"<p>Das folgende Beispiel zeigt wie man gezielt PowerShell oder Umgebungsvariablen in einem String aufl\u00f6sen kann:<\/p>\n<pre><code class=\"language-powershell\"># Test string (Please note I use ' ' and not \" \" to make sure they are not expanded)\n$String = 'Test string with env variable [$env:WinDir] and powershell variable [$PSHOME]'\n\n# Expand Environment Variables in a string\n[System.Environment]::ExpandEnvironmentVariables($String)\n\n# Expand PowerShell Variables in a string\n$ExecutionContext.InvokeCommand.ExpandString($String)\n <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In diesem Beitrag zeige ich wie man gezielt PowerShell oder Umgebungsvariablen in einem String aufl\u00f6sen kann<\/p>\n","protected":false},"author":2,"featured_media":2425,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-2512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"_links":{"self":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts\/2512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2512"}],"version-history":[{"count":0,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts\/2512\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/media\/2425"}],"wp:attachment":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}