Set Powershell profile variables

 If you need to set certain values in your powershell profile then you can do with this simple how-to, first start powershell

Then type : notepad  $profile

If you do not have a profile file you will be asked if you want to create one.

Obviously your response here is "yes" you want to create it then once you have created this file, you can set all your variables which it will load on start-up all the time, here I set my proxy server ad I required TLS1.2 only as SSL should not be used anymore:

[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://proxy.bears.cloud:3129')[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Previous Post Next Post

نموذج الاتصال