From 6b8ccd5bbec5d94d3091a9c6244c8009cad85094 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Mon, 7 May 2018 23:15:41 +0100 Subject: [PATCH 1/2] Add microsoft/powershell:NanoServer example and simplify all docker examples to use the microsoft/powershell image tags --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 151e32127..c125794d2 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,16 @@ Exit - 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/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/powershell pwsh -c "Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` +- Docker image tags from [microsoft/powershell](https://hub.docker.com/r/microsoft/powershell/) (tested only using Docker CE on Windows 10 1803): + - Windows NanoServer (note that the [microsoft/nanoserver](https://hub.docker.com/r/microsoft/windowsservercore/) image does not work because it contains version 5.1 of PowerShell Core) - Example: + + ```docker run -it microsoft/powershell:nanoserver pwsh -command "Save-Module -Name PSScriptAnalyzer -Path .; Import-Module C:\PSScriptAnalyzer; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` + - Windows Server Core (note that the [microsoft/windowsservercore](https://hub.docker.com/r/microsoft/windowsservercore/) image works alternatively as well) - Example: + + ```docker run -it microsoft/powershell:nanoserver pwsh -command "Save-Module -Name PSScriptAnalyzer -Path .; Import-Module C:\PSScriptAnalyzer; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` + - Linux - Example: + + ```docker run -it microsoft/powershell pwsh -c "Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` ### From Source From 8c30d08467f226dca014b2a65ca1de2feeec8b24 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Tue, 8 May 2018 00:04:33 +0100 Subject: [PATCH 2/2] summarise and unify --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c125794d2..fb843c75e 100644 --- a/README.md +++ b/README.md @@ -78,16 +78,16 @@ Exit - Windows PowerShell 3.0 or greater - PowerShell Core on Windows/Linux/macOS -- Docker image tags from [microsoft/powershell](https://hub.docker.com/r/microsoft/powershell/) (tested only using Docker CE on Windows 10 1803): - - Windows NanoServer (note that the [microsoft/nanoserver](https://hub.docker.com/r/microsoft/windowsservercore/) image does not work because it contains version 5.1 of PowerShell Core) - Example: +- Docker (tested only using Docker CE on Windows 10 1803 + - PowerShell 6 Windows Image tags using from [microsoft/powershell](https://hub.docker.com/r/microsoft/powershell/): `nanoserver`, `6.0.2-nanoserver`, `6.0.2-nanoserver-1709`, `windowsservercore` and `6.0.2-windowsservercore`. Example (1 warning gets produced by `Save-Module` but can be ignored): - ```docker run -it microsoft/powershell:nanoserver pwsh -command "Save-Module -Name PSScriptAnalyzer -Path .; Import-Module C:\PSScriptAnalyzer; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` - - Windows Server Core (note that the [microsoft/windowsservercore](https://hub.docker.com/r/microsoft/windowsservercore/) image works alternatively as well) - Example: + ```docker run -it microsoft/powershell:nanoserver pwsh -command "Save-Module -Name PSScriptAnalyzer -Path .; Import-Module .\PSScriptAnalyzer; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` + - PowerShell 5.1 (Windows): Only the [microsoft/windowsservercore](https://hub.docker.com/r/microsoft/windowsservercore/) images work but not the [microsoft/nanoserver](https://hub.docker.com/r/microsoft/windowsservercore/) images because they contain a Core version of it. Example: - ```docker run -it microsoft/powershell:nanoserver pwsh -command "Save-Module -Name PSScriptAnalyzer -Path .; Import-Module C:\PSScriptAnalyzer; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` - - Linux - Example: + ```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'"``` + - Linux tags from [microsoft/powershell](https://hub.docker.com/r/microsoft/powershell/): `latest`, `ubuntu16.04`, `ubuntu14.04` and `centos7`. - Example: - ```docker run -it microsoft/powershell pwsh -c "Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` + ```docker run -it microsoft/powershell:latest pwsh -c "Install-Module PSScriptAnalyzer -Force; Invoke-ScriptAnalyzer -ScriptDefinition 'gci'"``` ### From Source