Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LabtechConsulting/LabTech-Powershell-Module/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The LabTech PowerShell module maintains an in-memory proxy object ($Script:LTProxy) that is applied automatically to every download operation — including Install-LTService, Uninstall-LTService, and Update-LTService. Two functions manage this state:
| Function | Purpose |
|---|---|
Get-LTProxy | Reads proxy settings from the installed agent registry (or system settings if no agent is present) and loads them into module memory. |
Set-LTProxy | Writes proxy settings to module memory and, if the agent is installed, persists them to HKLM:\SOFTWARE\LabTech\Service\Settings and restarts the agent services. |
Set-LTProxy handles encoding automatically using ConvertTo-LTSecurity before writing.
Reading current proxy settings
Get-LTProxy has no parameters. It reads from the installed agent’s registry settings first. If no agent is present, it falls back to the system-level proxy discovery.
The discovered settings are loaded into $Script:LTProxy for use by all module functions during the current session, and the object is returned.
Setting a proxy server
UseSet-LTProxy -ProxyServerURL to configure the proxy for module operations and for the installed agent.
Set-LTProxy encodes the username and password with ConvertTo-LTSecurity, writes them to HKLM:\SOFTWARE\LabTech\Service\Settings, and restarts LTService and LTSvcMon for the changes to take effect.
Using encoded credentials
If the proxy credentials are already encoded with the agent password (for example, from a backup or existing registry values), use theEncodedProxyUsername and EncodedProxyPassword parameters. The module decodes them using ConvertFrom-LTSecurity before applying.
Auto-detecting system proxy
-DetectProxy instructs Set-LTProxy to use [System.Net.WebRequest]::GetSystemWebProxy() and netsh winhttp show proxy to discover the proxy in use on the system. Detected settings are applied to both the module session and the agent registry.
Disabling the proxy
-ResetProxy clears all proxy settings from the module session and from the agent registry.
$Script:LTProxy.Enabled is $False and a plain System.Net.WebProxy (no proxy) is assigned to the module’s web client.
How proxy settings apply to downloads
When$Script:LTProxy.Enabled is $True, all web requests made by the module automatically route through the configured proxy. This includes:
Install-LTService— MSI download from the server or installer token URLUninstall-LTService— uninstall MSI andAgent_Uninstall.exedownloadsUpdate-LTService—LabtechUpdate_<version>.zipdownload
System.Net.WebRequest level before each download:
Get-LTProxy (or Set-LTProxy) before any install or update operation ensures the correct proxy is in use for the entire operation.