{"id":76733,"date":"2016-02-06T00:01:11","date_gmt":"2016-02-06T00:01:11","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=76733"},"modified":"2019-02-18T09:19:58","modified_gmt":"2019-02-18T16:19:58","slug":"powertip-open-a-script-in-powershell-ise","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-open-a-script-in-powershell-ise\/","title":{"rendered":"PowerTip: Open a script in PowerShell ISE"},"content":{"rendered":"<p><strong>Summary<\/strong>: Automatically open a script in the Windows PowerShell ISE.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>\u00a0How can I automatically open a script in the Windows PowerShell ISE from within a script?<\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>\u00a0Use the Windows PowerShell ISE automation model, and use the <strong>Add<\/strong> method for the <strong>Files<\/strong> collection\non the current PowerShell tab, for example:<\/p>\n<p style=\"padding-left: 120px\">$psISE.CurrentPowerShellTab.Files.Add(&#8220;C:\\fso\\backup.ps1&#8221;)<\/p>\n<p style=\"padding-left: 30px\">\u00a0<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\" \" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Automatically open a script in the Windows PowerShell ISE. \u00a0How can I automatically open a script in the Windows PowerShell ISE from within a script? \u00a0Use the Windows PowerShell ISE automation model, and use the Add method for the Files collection on the current PowerShell tab, for example: $psISE.CurrentPowerShellTab.Files.Add(&#8220;C:\\fso\\backup.ps1&#8221;) \u00a0<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[568],"tags":[356,3,45],"class_list":["post-76733","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hey-scripting-guy","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Automatically open a script in the Windows PowerShell ISE. \u00a0How can I automatically open a script in the Windows PowerShell ISE from within a script? \u00a0Use the Windows PowerShell ISE automation model, and use the Add method for the Files collection on the current PowerShell tab, for example: $psISE.CurrentPowerShellTab.Files.Add(&#8220;C:\\fso\\backup.ps1&#8221;) \u00a0<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/76733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=76733"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/76733\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=76733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=76733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=76733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}