Skip to content

Conversation

@mchave3
Copy link
Contributor

@mchave3 mchave3 commented Jan 14, 2025

Proposed Changes

I've implemented several improvements in the “Test-Network” and “Write-ToLog” functions :

Improved Logging function :

  • Changed $LogMsg to a mandatory parameter.
  • Optimized ACL settings for the log file.
  • Added try/catch block for error handling.
  • Modified the "Echo log" behavior to improve clarity.
  • Added UTF-8 encoding for better character support.

Enhanced Test-Network function:

  • Added robust error handling for registry key access and web requests.
  • Introduced configurable parameters for timeout and retry intervals.
  • Improved logging with detailed error messages for troubleshooting.
  • Refactored metered connection check for better readability and maintainability.
  • Ensured default fallback values for NCSI parameters when registry keys are unavailable.

Related Issues

(Github link to related issues or pull requests)

- Changed $LogMsg to a mandatory parameter.
- Optimized ACL settings for the log file.
- Added try/catch block for error handling.
- Modified the "Echo log" behavior to improve clarity.
- Added UTF-8 encoding for better character support.
- Added robust error handling for registry key access and web requests.
- Introduced configurable parameters for timeout and retry intervals.
- Improved logging with detailed error messages for troubleshooting.
- Restored notification logic:
  - Warning notification after 5 minutes of no connection.
  - Timeout notification after 30 minutes of no connection.
- Refactored metered connection check for better readability and maintainability.
- Ensured default fallback values for NCSI parameters when registry keys are unavailable.
- # DevSkim: ignore DS137138 Insecure URL
Copy link
Owner

@Romanitho Romanitho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help ;)

Write-ToLog "WAU is configured to force update checking on metered connection"
return $true

}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing this part of the logs. If you think it's not important, that's fine with me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly, I forgot this part, you can put it back.

@AndrewDemski-ad-gmail-com
Copy link
Contributor

Hi, why the Devskim error suppression was removed?
I do not see any benefit coming from that decision.

@Romanitho
Copy link
Owner

Closing this PR as isn’t planned for now.

@Romanitho Romanitho closed this Feb 21, 2025
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

Successfully merging this pull request may close these issues.

3 participants