I hope some very clever person out there can resolve this without even thinking, however my brain seems to be blocked.
$FileVersion= (Get-ChildItemC:\Windows\System32\drivers\somedriver.SYS).VersionInfo|Select-ObjectFileVersion
If ($FileVersion-eq"2, 0, 0, 1") {Copy-Item-Force"C:\local\somedriver.SYS","C:\Windows\System32\drivers\somedriver.SYS"}
I have verified this and $FileVersion does in fact equal 2, 0, 0, 1 however starts as a formatted table.
FileVersion
-----------------
2, 0, 0, 1
I think it must be passing the variable as the whole table, I also tried adding in my if statement the value @{FileVersion=2, 0, 0, 1 however that also failed.
Any ideas what I'm missing here?
Many Thanks