It’s not possible to change a method’s visibility at runtime in PowerShell classes. The private
or hidden
keywords must be used at design time. Get-Member
will always show public methods defined in the class, and attributes like Browsable
cannot dynamically hide them once the class is compiled.