PowerShellForGitHub icon indicating copy to clipboard operation
PowerShellForGitHub copied to clipboard

Added TLS 1.3 support and fixed strict-mode variable errors in tests

Open variableresistor opened this issue 1 year ago • 2 comments

Description

Added support for TLS 1.3

Issues Fixed

Fixes #443

References

Checklist

  • [x] You actually ran the code that you just wrote, especially if you did just "one last quick change".
  • [x] Comment-based help added/updated, including examples.
  • [x] Static analysis is reporting back clean.
  • [x] New/changed code adheres to our coding guidelines.
  • [x] Formatters were created for any new types being added.
  • [x] New/changed code continues to support the pipeline.
  • [x] Changes to the manifest file follow the manifest guidance.
  • [x] Unit tests were added/updated and are all passing. See testing guidelines. This includes making sure that all pipeline input variations have been covered.
  • [x] Relevant usage examples have been added/updated in USAGE.md.
  • [x] If desired, ensure your name is added to our Contributors list

variableresistor avatar Jan 08 '25 16:01 variableresistor

@variableresistor - This is a great idea. I didn't realize that PS Core 7+ supported TLS 1.3.

That being said, I'm not confident with the change.

I opened up a Windows PowerShell console:

C:\Users\howard> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      26100  2161

C:\Users\howard> $PSVersionTable.PSVersion -lt 7.0.0
False


C:\Users\howard> $PSVersionTable.PSVersion -lt 5.01.26100
False
C:\Users\howard> $PSVersionTable.PSVersion -lt 5.01.26101
False
C:\Users\howard> $PSVersionTable.PSVersion -lt 5.1.26101
False
C:\Users\howard> $PSVersionTable.PSVersion -lt 5.1.26100
False

Looking online, it looks like there's more that needs to be done than what you currently have in this PR.

Thanks @HowardWolosky for the quick reply. I'll check that link and get back with you shortly.

variableresistor avatar Jan 08 '25 16:01 variableresistor

Fixed it. To test:

powershell -Command '$PSVersionTable.PSVersion -lt [version]"7.0.0"'
True
pwsh -Command '$PSVersionTable.PSVersion -lt [version]"7.0.0"'
False

variableresistor avatar Jan 08 '25 16:01 variableresistor