Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I have built a GUI in PowerShell Studio as a Project (e.g. multi file \ form). I have deployed it via the Export to File option (which seems to have merged and joined all my files into a single ps1 file). I've noticed in the generated \ deployed .ps1 file there is no [CmdletBinding()] at the top. As such, my write-verbose commands are not working \ visible in the console used to launch the .ps1 file. Other than manually editing the generated \ deployed .ps1 file and adding the snippet below, how would I go about getting CmdletBinding enabled on my the generated \ deployed .ps1 file?
Well - you really can't because a project is wrapped in a "Main" (in startup.pss) and it has not binding. You can set the global verbose preferences in your profile to see if it will propagate.
Verbose acts in the local scope and all child scopes. Global scope sets the default for everything.
This topic is 7 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.