From c26408bc330d6476676614c3cd57222c49206aef Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Sun, 6 May 2018 23:47:25 +0100 Subject: [PATCH 1/2] add working docker images with examples --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a8eca1076..e46d8f4a7 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Table of Contents - [Usage](#usage) - [Installation](#installation) + [From PowerShell Gallery](#from-powershell-gallery) - - [Requirements](#requirements) + - [Supported PowerShell Versions and Platforms](#supported-powerShell-versions-and-platforms) * [Windows](#windows) * [Linux (*Tested only on Ubuntu 14.04*)](#linux-tested-only-on-ubuntu-1404) + [From Source](#from-source) @@ -70,14 +70,19 @@ Install-Module -Name PSScriptAnalyzer **Note**: For PowerShell version `5.1.14393.206` or newer, before installing PSScriptAnalyzer, please install the latest Nuget provider by running the following in an elevated PowerShell session. ```powershell -Install-PackageProvider Nuget –force –verbose +Install-PackageProvider Nuget -MinimumVersion 2.8.5.201 –Force Exit ``` -#### Requirements +#### Supported PowerShell Versions and Platforms - Windows PowerShell 3.0 or greater - PowerShell Core on Windows/Linux/macOS +- Docker (tested only using Docker CE on Windows 10 1803): + - [microsoft/windowsservercore](https://hub.docker.com/r/microsoft/windowsservercore/) for Windows. Example: + ```docker run --it microsoft/powershell pwsh -c "Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` + - [microsoft/powershell](https://hub.docker.com/r/microsoft/powershell/) for Linux. Example: + ```docker run --it microsoft/windowsservercore powershell -command "$null = Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force; Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` ### From Source From ce3f47f831cf1f2bdcd889e9f2225f88e4fe6f3a Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Mon, 7 May 2018 10:26:21 +0100 Subject: [PATCH 2/2] Fix docker scripts (--it should have been -it and Windows/Linux command were the wrong way around) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e46d8f4a7..151e32127 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,9 @@ Exit - PowerShell Core on Windows/Linux/macOS - Docker (tested only using Docker CE on Windows 10 1803): - [microsoft/windowsservercore](https://hub.docker.com/r/microsoft/windowsservercore/) for Windows. Example: - ```docker run --it microsoft/powershell pwsh -c "Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` + ```docker run -it microsoft/windowsservercore powershell -command "Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force; Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` - [microsoft/powershell](https://hub.docker.com/r/microsoft/powershell/) for Linux. Example: - ```docker run --it microsoft/windowsservercore powershell -command "$null = Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force; Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` + ```docker run -it microsoft/powershell pwsh -c "Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` ### From Source