Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PowerShell$Profile添加$psISE.CurrentFile.Editor.toggleOutlineingExpansion()以折叠打开的所有#区域_Powershell_Powershell 3.0_Powershell Ise_Powershell 5.0 - Fatal编程技术网

PowerShell$Profile添加$psISE.CurrentFile.Editor.toggleOutlineingExpansion()以折叠打开的所有#区域

PowerShell$Profile添加$psISE.CurrentFile.Editor.toggleOutlineingExpansion()以折叠打开的所有#区域,powershell,powershell-3.0,powershell-ise,powershell-5.0,Powershell,Powershell 3.0,Powershell Ise,Powershell 5.0,我希望在打开带有#区域的脚本时关闭所有#区域。我的最终目标。。。 在$Profile中 在管理员模式下打开PowerShell ISE 打开一个.PS1文件 在脚本打开时折叠所有可折叠的#区域。*$psISE.CurrentFile.Editor.toggleOutlineingExpansion() 这管用!如果您单击.PS1并打开它,命令将失败,但如果您打开PowerShell,然后打开一个文件,它将100%崩溃!谢谢有没有一种方法可以在不首先打开PowerShell的情况下打开折叠的.PS

我希望在打开带有#区域的脚本时关闭所有#区域。我的最终目标。。。 在$Profile中

  • 在管理员模式下打开PowerShell ISE
  • 打开一个.PS1文件
  • 在脚本打开时折叠所有可折叠的#区域。*$psISE.CurrentFile.Editor.toggleOutlineingExpansion()

  • 这管用!如果您单击.PS1并打开它,命令将失败,但如果您打开PowerShell,然后打开一个文件,它将100%崩溃!谢谢有没有一种方法可以在不首先打开PowerShell的情况下打开折叠的.PS1文件?如果先打开PS,然后打开文件>打开并选择“文件”,则该方法有效。如果选择.PS1文件,请单击“打开”,它将不起作用。(我确实关闭了ISE)。你给了我我想要的。我只是没有“要求”我想要的!如果没有rt click.PS1脚本打开collapsedYUP的方法,我可以使用它!成功了---感谢你在不到一小时的时间里给出了两个精彩的答案。我想要的和我需要的。。。谢谢你,佩瑟莱