From bb18e19e2101a3bccb8559f977b4dbf8fe83de29 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Mon, 23 Jan 2017 14:14:47 -0800 Subject: [PATCH] Update docs with install options Also improve batch script usage help and update the docs to reflect the ability to run runtime tests in Docker. --- CONTRIBUTING.md | 15 ++++++++++++++- README.md | 15 +++++++++++++-- test/docker/run.cmd | 10 +++++++++- test/docker/test.cmd | 5 ++++- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb633a0..1849fed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,11 +38,23 @@ All available tests are discovered after a complete build in Test Explorer withi On the command line, you can run the following commands from the solution directory. Replace `` with whatever version was downloaded. -``` +```batch nuget install xunit.runner.console -outputdirectory packages packages\xunit.runner.console.\tools\xunit.runner.console test\VSSetup.PowerShell.Test\bin\Debug\Microsoft.VisualStudio.Setup.PowerShell.Test.dll ``` +It's also recommended that, if your machine supports it, you install [Docker for Windows][docker], switch to Windows containers, and test in isolated containers for runtime behavior. + +```batch +# You only need to build once unless changing files under test\docker. +test\docker\build.cmd + +# This will automatically map build output. Defaults to Debug configuration. Pass -? for options. +test\docker\test.cmd +``` + +You can also run `test\docker\run.cmd` to start an interactive shell for exploratory testing. + ## Pull Requests We welcome pull requests for both bug fixes and new features that solve a common enough problem to benefit the community. Please note the following requirements. @@ -52,6 +64,7 @@ We welcome pull requests for both bug fixes and new features that solve a common Thank you for your contributions! + [docker]: https://www.docker.com/products/overview [samples]: https://aka.ms/setup/configuration/samples [docs]: https://aka.ms/setup/configuration/docs [interop]: https://aka.ms/setup/configuration/interop diff --git a/README.md b/README.md index 7e15597..29ced4b 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,20 @@ This PowerShell module contains cmdlets to query instances of Visual Studio 2017 ## Installing -You can download packages from the Releases page for this project on GitHub, but with Windows Management Framework 5.0 or newer (which installs PowerShell and comes with Windows 10), you can download and install this module even easier. +With Windows Management Framework 5.0 or newer (which installs PowerShell and comes with Windows 10), or [PowerShellGet][oneget] for PowerShell 3.0 or 4.0, you can download and install this module easily. ```powershell Install-Module VSSetup -Scope CurrentUser ``` +To install for all users, pass `AllUsers` instead of `CurrentUser`, or just leave the `-Scope` parameter out of the command entirely. + +You can also download the ZIP package from the [Releases][releases] page on this project site and extract to a directory named _VSSetup_ under a directory in your `$env:PSMODULEPATH`. + +```powershell +Expand-Archive VSSetup.zip "${env:USERPROFILE}\Documents\WindowsPowerShell\Modules\VSSetup" +``` + ## Using You can query all usable instances of Visual Studio and other products installed by the Visual Studio installer. @@ -33,7 +41,7 @@ Get-VSSetupInstance -All | Select-VSSetupInstance -Require 'Microsoft.VisualStud ## Feedback -To file issues or suggestions, please use the Issues page for this project on GitHub. +To file issues or suggestions, please use the [Issues][issues] page for this project on GitHub. ## Status @@ -44,4 +52,7 @@ Branch | Status master | [![build status: master](https://ci.appveyor.com/api/projects/status/4c1feyut6rvmw1dk/branch/master?svg=true)](https://ci.appveyor.com/project/heaths/vssetup-powershell/branch/master) develop | [![build status: develop](https://ci.appveyor.com/api/projects/status/4c1feyut6rvmw1dk/branch/develop?svg=true)](https://ci.appveyor.com/project/heaths/vssetup-powershell/branch/develop) + [issues]: https://github.com/Microsoft/vssetup.powershell/issues + [oneget]: http://go.microsoft.com/fwlink/?LinkID=746217 + [releases]: https://github.com/Microsoft/vssetup.powershell/releases [samples]: https://aka.ms/setup/configuration/samples diff --git a/test/docker/run.cmd b/test/docker/run.cmd index a094fc6..338dd78 100644 --- a/test/docker/run.cmd +++ b/test/docker/run.cmd @@ -5,6 +5,8 @@ REM Licensed under the MIT license. See LICENSE.txt in the project root for lice setlocal +if "%script%"=="" set script=%~nx0 + set projectDir=%~dp0 set solutionDir=%projectDir:~0,-12% @@ -46,8 +48,12 @@ echo. goto :EOF :help +set usage=%script% [options] [-?] +if "%noargs%"=="" ( + set usage=%usage% [-- args] +) echo. -echo %~nx0 [options] [-?] [-- ] +echo %usage% echo. echo Options: echo -name Image name. Defaults to vssetup/test. @@ -56,8 +62,10 @@ echo -network External network name. Defaults to discovered transparent ne echo -keep Do not delete the container after exiting. echo -? Displays this help message. echo. +if "%noargs%"=="" ( echo Arguments: echo -- Any arguments after -- are passed to the container entry point. echo. +) exit /b 87 diff --git a/test/docker/test.cmd b/test/docker/test.cmd index de7b9e9..5561dfa 100644 --- a/test/docker/test.cmd +++ b/test/docker/test.cmd @@ -5,4 +5,7 @@ REM Licensed under the MIT license. See LICENSE.txt in the project root for lice setlocal -%~dp0run.cmd %* -- -c Invoke-Pester C:\Tests -EnableExit +set script=%~nx0 +set noargs=1 + +call %~dp0run.cmd %* -- -c Invoke-Pester C:\Tests -EnableExit