From 7019e1c02f678b167e950fb553169e1bb58b7010 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 10 Apr 2022 11:09:43 +0200 Subject: [PATCH] Make sure that update-assemblyinfo.ps1 fails if PowerShell >= 5.0 is not installed. --- BuildTools/update-assemblyinfo.ps1 | 9 +++++++-- ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj | 2 +- README.md | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/BuildTools/update-assemblyinfo.ps1 b/BuildTools/update-assemblyinfo.ps1 index 0b5985a34..b07199c82 100644 --- a/BuildTools/update-assemblyinfo.ps1 +++ b/BuildTools/update-assemblyinfo.ps1 @@ -1,4 +1,9 @@ -$ErrorActionPreference = "Stop" +if (-not ($PSVersionTable.PSCompatibleVersions -contains "5.0")) { + Write-Error "This script requires at least powershell version 5.0!"; + return 255; +} + +$ErrorActionPreference = "Stop" $baseCommit = "d779383cb85003d6dabeb976f0845631e07bf463"; $baseCommitRev = 1; @@ -98,7 +103,7 @@ try { } if (-not (Test-File "ILSpy.sln")) { - Write-Host "Working directory must be the ILSpy repo root!"; + Write-Error "Working directory must be the ILSpy repo root!"; return 2; } diff --git a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj index 3b0b7541f..929b2ca55 100644 --- a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj +++ b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj @@ -685,7 +685,7 @@ - + diff --git a/README.md b/README.md index 740589e84..faf0df113 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ How to build #### Windows: +- Make sure PowerShell (at least version) 5.0 is installed. - Clone the ILSpy repository using git. - Execute `git submodule update --init --recursive` to download the ILSpy-Tests submodule (used by some test cases). - Install Visual Studio (documented version: 17.1). You can install the necessary components in one of 3 ways: