Summary: Learn how to hide common code in the Windows PowerShell ISE.
How can I hide related code in the Windows PowerShell ISE to make it easier to troubleshoot and to read?
Open the ISE, and in the script pane, begin a section with the #Region tag and a name.
Then end the section with the #EndRegion tag. Now everything between the two tags can be collapsed
and hidden when desired. Here is an example:
#region Name
If($d.name -match ‘,’)
{
$name = (Get-Culture).textinfo.ToTitleCase($d.name).Split(‘,’).trim()
$ln = $name[0]
$fn = $name[1]
}
#endregion
0 comments