{"id":587,"date":"2015-01-06T10:05:46","date_gmt":"2015-01-05T23:05:46","guid":{"rendered":"http:\/\/threemillion.net\/blog\/?p=587"},"modified":"2017-05-31T14:35:55","modified_gmt":"2017-05-31T04:35:55","slug":"run-powershell-script-with-parameters-from-command-line","status":"publish","type":"post","link":"https:\/\/threemillion.net\/blog\/?p=587","title":{"rendered":"Run PowerShell Script with Parameters from Command line"},"content":{"rendered":"<p><code>powershell.exe -File myscript.ps1 param1 param2<\/code><\/p>\n<p><strong>-File<\/strong><br \/>\nRuns the specified script in the local scope (&#8220;dot-sourced&#8221;), so that the functions and variables that the script creates are available in the current session. Enter the script file path and any parameters.<br \/>\n<strong>File must be the last parameter <\/strong>in the command, because all characters typed after the File parameter name are interpreted as the script file path <strong>followed by the script parameters<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>powershell.exe -File myscript.ps1 param1 param2 -File Runs the specified script in the local scope (&#8220;dot-sourced&#8221;), so that the functions and variables that the script creates are available in the current <a href=\"https:\/\/threemillion.net\/blog\/?p=587\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[8],"tags":[],"class_list":["entry","author-admin","post-587","post","type-post","status-publish","format-standard","category-powershell"],"_links":{"self":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=587"}],"version-history":[{"count":3,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/587\/revisions"}],"predecessor-version":[{"id":784,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/587\/revisions\/784"}],"wp:attachment":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}