PowerShell / Operation-Validation-Framework

MIT License
225 stars 32 forks source link

fixed version check #36

Closed miketheitguy closed 5 years ago

miketheitguy commented 5 years ago

Whenever you use Invoke-OperationValidation, you receive an error that it cannot compare an int to the System.Management.Automation.SemanticVersion type.

In addition, due to this version check failure, the call to Import-PowerShellDataFile never succeeds.

Description

Since the code is only checking the major version in the check (in this case, 5) -- I simply pull $PSVersionTable.PSVersion.Major, which itself is an int32, which resolves this error.

Related Issue

Motivation and Context

I like my stuff to work :)

How Has This Been Tested?

I have not tested this change, but I assume this is undesirable behavior and it's a relatively simple fix.

Screenshots (if appropriate):

Types of changes

Checklist:


This change is Reviewable

devblackops commented 5 years ago

Thanks for fixing this @miketheitguy!