Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization Issue for proxy detection #9

Open
zimbo86 opened this issue Mar 14, 2024 · 0 comments
Open

Localization Issue for proxy detection #9

zimbo86 opened this issue Mar 14, 2024 · 0 comments

Comments

@zimbo86
Copy link

zimbo86 commented Mar 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant