sudo
sudo copied to clipboard
Improved the script
- Changed the function name to PowerShell valid function name syntax.
- Added proper error types to the throw statements. It's best practice and also allows for catching specific errors later on when needed.
- Changed some variable types to full types instead of using type accelerators for better clarity.
- Removed all the unnecessary trailing whitespaces.
- Used
\s+$in VS Code's search as regex.
- Used
- Changed double quotes to single quotes wherever possible for improved security, speed and to prevent string interpolation.
@microsoft-github-policy-service agree