FILE: C:\ProgramData\PuppetLabs\puppet\var\lib\facter\pleskmajorversion.rb

--
Facter.add("plesk_version_major") do confine :osfamily => "windows" setcode do powershell = 'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile' command = 'if(Test-Path $env:Plesk_Dir\Version -ErrorAction SilentlyContinue){$(Get-Content $env:Plesk_Dir\Version | ForEach-Object {$_.Split(\" \")} | Select-Object -First 1 | ForEach-Object {$_.Split(\".\")} | Select-Object -First 1)}else{\"0\"}' Facter::Util::Resolution.exec(%Q{#{powershell} -command "#{command}"}) end end
--