If your computer is on a corporate network behind a proxy server, by default you won’t be able to access external web resources from your PowerShell CLI. For example, you won’t be able to get the content of an external web page using the Invoke-WebRequest cmdlet, update help using the Update-Help, connect to Azure/Microsoft 365 tenant (Exchange Online PowerShell module), install modules from PSGallery, or RSAT capabilities, download an application package or System Drivers from an external software repository ( external FTP share). This is very annoying but don’t worry, I am happy to offer the solution for you!!!
PowerShell Script
By default, the PowerShell Script Execution Policy doesn’t allow PS scripts to run, even from PowerShell profile files. To allow PS1 scripts to run, you need to change your PowerShell Execution Policy settings.
Download the script file and add it to your actual script which requires access to external data through a proxy server.
Please ensure you perform adequate testing before using the script in your environment.
* Please feel free to reach out with any comments or questions!
Related Posts
- Powershell – Get System up time
- Powershell Script : List AD Organizational Unit and GPOs linked to them
- Powershell – Compare hardware and software details on two computers
- Powershell Script : Retrieve AD Computers Properties
- Powershell – Merge CSV files & Insert file name as a column
- Powershell Script: Validate if Computer account exists in Active Directory
- Powershell remote – WinRM cannot complete the operation
- Powershell script to Add bulk users / computers to AD Group
- PowerShell Script : Copy AD Group Membership
- Using PowerShell Behind a Proxy Server
Subscribe to Techuisitive Newsletter
Be the first to know about our new blog posts. Get our newsletters directly in your inbox and stay up to date about Modern Desktop Management technologies & news.