FriendsOfMDT / PSD

PowerShell Deployment
MIT License
525 stars 83 forks source link

How to collapse Treeview in Select a Task Sequence by default #127

Closed JerichoJones closed 9 months ago

JerichoJones commented 10 months ago

To make the selection screen more readable I'd like to make Collapse All the default. How can I do that?

Thanks!

PowerShellCrack commented 9 months ago

This currently cannot be controlled by the customsettings.ini (but could be a feature request).

There is a section in the PSDWizardNew.psm1 that provides action to the two buttons when the task sequence page is loaded. This is ideal place to add some additional code that will collapse the tree automatically. In between line 1158 and 1159; add:

#collapse all items on load
For($i=0; $i -lt $_tsTabTree.Items.Count; $i++)
{
    $_tsTabTree.Items[$i].IsExpanded = $false;
}

Since you are editing the module, it will require you to update your deployment share and create a new boot file.

WARNING: If at any point you update your deployment share with updated PSD code, it will be lost.

Let me know if this worked for you

JerichoJones commented 9 months ago

I'm having firewall issues so I can't auth but I'll test it as soon as this other issue is resolved.

JerichoJones commented 9 months ago

It's working. Thanks!