在ISE编辑器中使用Regions分割代码块


PowerShell 3.0 ISE编辑器会自动创建折叠代码框,用户可以折叠循环,条件,函数语句等。另外,可以通过region和endregion为脚本块自定义折叠框。

#region
Get-Process
Get-ChildItem
#endregion

必须确保region关键字放在注释行中,并且#号和region关键字中间不能有空格,另外region关键字大小写敏感,必须为小写。

原文链接:Using Regions in ISE Editor

本文链接: https://www.pstips.net/using-regions-in-ise-editor.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

关于 Mooser Lee

我是一个Powershell的爱好者,创建了PowerShell中文博客,热衷于Powershell技术的搜集和分享。本站部分内容来源于互联网,不足之处敬请谅解,并欢迎您批评指正。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注