From ca33a67e58829d4db8e930814e9ef8ebd5ca9965 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 1 Apr 2020 16:57:54 -0700 Subject: [PATCH] use psversiontable --- windows-installer/template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows-installer/template.nsi b/windows-installer/template.nsi index dd4c251e8..dc153f314 100644 --- a/windows-installer/template.nsi +++ b/windows-installer/template.nsi @@ -20,7 +20,7 @@ SetCompressor lzma Function .onInit ; Check that Powershell is at least 5.0. - nsExec::ExecToStack `powershell -ExecutionPolicy RemoteSigned -Command "Write-Host -NoNewline (Get-Host | Select-Object Version).Version.CompareTo([System.Version]'5.0')"` + nsExec::ExecToStack `powershell -ExecutionPolicy RemoteSigned -Command "Write-Host -NoNewline $$PSVersionTable.PSVersion.Major.CompareTo(5)"` Pop $0 Pop $1 StrCmp $1 "-1" 0 powershellok