The UoR-FOE Proxy Configuration Module is designed to help students and staff of the Faculty of Engineering, University of Ruhuna, easily toggle proxy settings for NPM, Git, and Windows. This module provides a set of PowerShell functions to manage proxy settings, making it easier to switch between different proxy configurations.
To install the UoR-FOE Proxy Configuration Module, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/Sathursan-S/UorProxyConfig.git
-
Navigate to the repository directory:
cd UorProxyConfig
-
Import the module into your PowerShell session:
Import-Module .\UorProxyConfig.psd1
-
Verify that the module is imported successfully:
Get-Module -Name UorProxyConfig
You can also install the UoR-FOE Proxy Configuration Module from the PowerShell Gallery:
-
Open PowerShell with administrative privileges.
-
Run the following command to install the module:
Install-Module -Name UorProxyConfig -Repository PSGallery
-
Verify that the module is installed successfully:
Get-Module -Name UorProxyConfig
The Switch-Proxy
function provides a user interface for toggling proxy settings for NPM, Git, and Windows. It allows you to easily switch between different proxy configurations.
-
Run the
Switch-Proxy
function:Switch-Proxy
-
Follow the on-screen instructions to toggle proxy settings. Use the arrow keys to select an option and press Enter to confirm.
When you run the Switch-Proxy
function, you will see a menu with the following options:
╭──────----────────────────----------------------─────────────────────╮
│ UoR-FoE Proxy Config │
╰──────----────────────────----------------------─────────────────────╯
CURRENT PROXY STATUS:
Proxy Server : http://10.50.225.222:3128
Global : Enabled
NPM : Enabled
Git : Enabled
Proxy Env-Var : http://10.50.225.222:3128
TO TOGGLE PROXY SETTINGS:
Use the arrow keys to select an option and press Enter to confirm.
╰► Toggle Global Proxy
| Toggle Git Proxy
| Toggle NPM Proxy
| Exit(q)
Select the desired option to toggle the corresponding proxy settings.
This function retrieves the current proxy status for NPM, Git, and Windows.
- None
$currentProxyStatus = Get-CurrentProxyStatus
This function displays the current proxy status for NPM, Git, and Windows.
- None
Show-CurrentProxyStatus
This function toggles the Git proxy settings.
ProxySocketAddress
(Mandatory): The proxy server address to set.
Switch-Git-Proxy -ProxySocketAddress "http://10.50.225.222:3128"
This function toggles the global proxy settings for Windows.
ProxySocketAddress
(Mandatory): The proxy server address to set.
Switch-Global-Proxy -ProxySocketAddress "http://10.50.225.222:3128"
This function toggles the NPM proxy settings.
ProxySocketAddress
(Mandatory): The proxy server address to set.
Switch-Npm-Proxy -ProxySocketAddress "http://10.50.225.222:3128"