Sometimes you need full administrator privileges to debug or test a script in the ISE script editor. By default, ISE starts with restricted privileges (when Windows User Account Control (UAC) is enabled).
To launch ISE with full privileges, right-click the PowerShell icon in your taskbar, and hold CTRL+SHIFT while you click on it. This key shortcut works for anything you click and invokes the UAC elevation dialog.