PowerShell-DevOps
PowerShell-DevOps copied to clipboard
- Fix $PSVersionTable.CLRVersion since it's deprecated in PS Core -> …
trafficstars
- Fix $PSVersionTable.CLRVersion since it's deprecated in PS Core -> https://github.com/PowerShell/PowerShell/issues/1395
Description
Import-Module fails on PS Core since there is no $PSVersionTable:CLRVersion. This is deprecated.
Related Issue
https://github.com/PowerShell/PowerShell/issues/1395
Motivation and Context
This fix will default $CLRVersion to 'Unknown' and only set it to a Version if it's available in $PSVersionTable.
How Has This Been Tested?
Local execution in PowerShell Core.
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
@MathieuBuisson the build failed due to issues of Merge-DscConfigData which was not touched/changed in this PR.