Skip to content

Localization Issue for proxy detection #9

Description

@zimbo86

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run the script on a German OS (Option 3)

Any log messages given by the failure

Start-ScheduledTask : Das Argument für den Parameter "InputObject" kann nicht überprüft werden. Das Argument ist NULL
oder leer. Geben Sie ein Argument an, das nicht NULL oder leer ist, und führen Sie den Befehl erneut aus.
In C:\Temp\DSRegTool-main\DSRegTool.ps1:1917 Zeichen:13
+     $Task | Start-ScheduledTask -AsJob -ErrorAction Stop | Wait-Job | ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Start-ScheduledTask], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Start-ScheduledTask

Expected/desired behavior

OS and Version?

Server 2019

Versions

Mention any other details that might be useful

Proxy detection is not localized corectly.
Output of netsh winhttp proxy on a German OS is:
DirectAccess (kein Proxyserver)
In line 765 you check for:
if ($global:ProxyServer -eq "Direct access (no proxy server)."){ $global:ProxyServer="NoProxy" If($Write){Write-Host "Access Type : DIRECT"; Write-Log -Message "Access Type : DIRECT"} }

So on a German OS the Check results in:
Invoke-WebRequest -uri 'https://login.microsoftonline.com/common/oauth2' -UseBasicParsing -Proxy http://DirectAccess (kein Proxyserver).).StatusCode

As quick fix i changed ln 765 to:
if ($global:ProxyServer -match "(.*no proxy server.*|.*kein Proxyserver.*)"){
but this only fixes is on German OS, not other languages.
Maybe there is a better way to check proxy settings.


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions