From 150d4e5588b950007b7d0b26a0d22efface544e6 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Fri, 29 Mar 2019 02:12:18 +0100 Subject: [PATCH] Fix for PowerShell 5 and colorized output --- MakeZipWindows.ps1 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) mode change 100644 => 100755 MakeZipWindows.ps1 diff --git a/MakeZipWindows.ps1 b/MakeZipWindows.ps1 old mode 100644 new mode 100755 index 1373d6882..87710ea31 --- a/MakeZipWindows.ps1 +++ b/MakeZipWindows.ps1 @@ -1,5 +1,7 @@ -#!powershell -# +#!/usr/bin/env pwsh + +Set-StrictMode -Version 5.0 + $include_files = @( 'addon.py', 'addon.xml', 'LICENSE', 'README.md', 'service.py' ) $include_paths = @( 'resources/' ) $exclude_files = @( '*.new', '*.orig', '*.pyc' ) @@ -17,9 +19,9 @@ if (Test-Path -LiteralPath $zip_name) { } # Create ZIP file -Add-Type -AssemblyName System.IO.Compression +Add-Type -AssemblyName System.IO.Compression.FileSystem -Write-Host '= Building new package' +Write-Host -fore blue '= Building new package' $zip_file = [System.IO.Compression.ZipFile]::Open($zip_name, 'Create') ForEach ($relative_file in $include_files) { $archive_file = Join-Path -Path $name -ChildPath $relative_file @@ -33,4 +35,5 @@ ForEach ($path in $include_paths) { } } $zip_file.Dispose() -Write-Host "= Successfully wrote package as: $zip_name" +Write-Host "= Successfully wrote package as: " -ForegroundColor:Blue -NoNewLine +Write-Host "$zip_name" -ForegroundColor:Cyan