From 8578c67bd048c4b5664fdd4df9658bf37fafb2c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20P=C5=82=C3=B3cieniak?= Date: Sat, 18 Nov 2017 12:59:38 +0100 Subject: [PATCH] Fixed problem with spaces in exe path Added README file with project description Updated module version --- README.md | 36 ++++++++++++++++++++++++++++++++++++ WebPI.PS.psd1 | 2 +- WebPI.PS.psm1 | 5 ++--- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1d27917..fda423d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,38 @@ # WebPI Power Shell +**WebPI Power Shell** is a wrapper for **WebPICMD.exe** written in PowerShell and shipped as Powershell Module + +**WebPICMD.exe**([WebPI Command line](https://docs.microsoft.com/en-us/iis/install/web-platform-installer/web-platform-installer-v4-command-line-webpicmdexe-rtw-release#using-webpicmdexe)) is a command line tool for managing **Web Platform Installer** + +The **Microsoft Web Platform Installer (Web PI)** is a free tool that makes getting the latest components of the Microsoft Web Platform, including Internet Information Services (IIS), SQL Server Express, .NET Framework and Visual Web Developer easy + + +# Installation +Module is available on [Powershell Gallery](https://www.powershellgallery.com/packages/WebPI.PS/) + +### Inspect +```powershell +PS> Save-Module -Name WebPI.PS -Path +``` +### Install +```powershell +PS> Install-Module -Name WebPI.PS +``` + +# Usage + +```powershell +PS> Import-Module WebPI.PS +PS> Invoke-WebPI /Install /Products:UrlRewrite2 +``` + +**Limitations** + +Due to the fact how PS split parameter if there is a comma in it, use double quote so whole string will be treated as a single param. + +```diff +- BAD +- Invoke-WebPI /Install /Products:UrlRewrite2,WDeploy36 ++ GOOD ++ Invoke-WebPI /Install "/Products:UrlRewrite2,WDeploy36" +``` \ No newline at end of file diff --git a/WebPI.PS.psd1 b/WebPI.PS.psd1 index 97896ff..930d497 100644 --- a/WebPI.PS.psd1 +++ b/WebPI.PS.psd1 @@ -4,7 +4,7 @@ RootModule = 'WebPI.PS.psm1' # Version number of this module. - ModuleVersion = '1.0.1' + ModuleVersion = '1.1.0' # ID used to uniquely identify this module GUID = 'add2ca98-860b-4313-9ad1-9ef90884e6ca' diff --git a/WebPI.PS.psm1 b/WebPI.PS.psm1 index a8ce2f5..b3f6c82 100644 --- a/WebPI.PS.psm1 +++ b/WebPI.PS.psm1 @@ -10,9 +10,8 @@ function Get-CurrentModulePath () { function Invoke-WebPI () { $CurrentModulePath = Get-CurrentModulePath - $arguments = $args -join ' ' - $CurrentModulePath = $CurrentModulePath.Replace(" ", "^ ") - cmd /c "$CurrentModulePath\webpi\WebpiCmd.exe $arguments" + $arguments = $args | % { $_} + & "$CurrentModulePath\webpi\WebpiCmd.exe" $arguments } $exportModuleMemberParams = @{