|
4 | 4 |
|
5 | 5 | 1. [Description](#description)
|
6 | 6 | 1. [Setup - The basics of getting started with powershellmodule](#setup)
|
7 |
| - * [Setup requirements](#setup-requirements) |
| 7 | + * [Windows PowerShell](#windows-powershell) |
| 8 | + * [PowerShell Core](#powershell-core) |
8 | 9 | 1. [Usage - Configuration options and additional functionality](#usage)
|
| 10 | + * [Windows PowerShell](#windows-powershell) |
| 11 | + * [PowerShell Core](#powershell-core) |
| 12 | + * [Side by side installation](#side-by-side-installation) |
9 | 13 | 1. [Limitations - OS compatibility, etc.](#limitations)
|
10 | 14 | 1. [Development - Guide for contributing to the module](#development)
|
11 | 15 |
|
12 | 16 | ## Description
|
13 | 17 |
|
14 |
| -This module adds a new type and provider for registering PowerShell repositories |
15 |
| -and a new package provider for installing PowerShell modules. |
| 18 | +This module allows PowerShell repositories to be registered as package sources |
| 19 | +and PowerShell modules to be installed using the Puppet Package type. |
| 20 | + |
| 21 | +The module supports Windows PowerShell (PowerShell 5) and PowerShell Core (PowerShell 6) |
16 | 22 |
|
17 | 23 | ## Setup
|
18 | 24 |
|
19 |
| -### Setup Requirements |
| 25 | +### Windows PowerShell |
20 | 26 |
|
21 |
| -The PowerShellGet PowerShell module must be installed as well as the NuGet package |
22 |
| -provider. PowerShellGet is included with WMF5 or can be installed for earlier |
| 27 | +For Windows PowerShell the PowerShellGet PowerShell module must be installed as well as |
| 28 | +the NuGet package provider. PowerShellGet is included with WMF5 or can be installed for earlier |
23 | 29 | versions here http://go.microsoft.com/fwlink/?LinkID=746217&clcid=0x409
|
| 30 | + |
24 | 31 | NuGet can be installed by running
|
25 |
| -Install-PackageProvider Nuget –Force |
26 | 32 |
|
27 |
| -### Beginning with powershellmodule |
| 33 | +`Install-PackageProvider Nuget –Force` |
| 34 | + |
| 35 | +### PowerShell Core |
| 36 | + |
| 37 | +PowerShellGet is included in PowerShell Core so no additional setup is necessary. |
28 | 38 |
|
29 | 39 | ## Usage
|
30 | 40 |
|
31 |
| -~~~ puppet |
| 41 | +### Windows PowerShell |
| 42 | + |
| 43 | +Windows users should remember that package names in Puppet are case sensitive. |
| 44 | + |
| 45 | +```puppet |
32 | 46 | psrepository { 'my-internal-repo':
|
33 | 47 | ensure => present,
|
34 | 48 | source_location => 'http://myrepo.corp.com/api/nuget/powershell',
|
35 | 49 | installation_policy => 'trusted',
|
| 50 | + provider => 'windowspowershell', |
36 | 51 | }
|
37 |
| -~~~ |
| 52 | +``` |
38 | 53 |
|
39 |
| -~~~ puppet |
40 |
| -package { 'pester': |
| 54 | +```puppet |
| 55 | +package { 'Pester': |
41 | 56 | ensure => '4.0.3',
|
42 | 57 | source => 'PSGallery',
|
43 |
| - provider => 'psmodule', |
| 58 | + provider => 'windowspowershell', |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +### PowerShell Core |
| 63 | + |
| 64 | +```puppet |
| 65 | +psrepository { 'my-internal-repo': |
| 66 | + ensure => present, |
| 67 | + source_location => 'http://myrepo.corp.com/api/nuget/powershell', |
| 68 | + installation_policy => 'trusted', |
| 69 | + provider => 'powershellcore', |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +```puppet |
| 74 | +package { 'Pester': |
| 75 | + ensure => '4.0.3', |
| 76 | + source => 'PSGallery', |
| 77 | + provider => 'powershellcore', |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +### Side by side installation |
| 82 | + |
| 83 | +On Windows, PowerShell Core is installed along side Windows PowerShell and maintains its |
| 84 | +modules separately. To install the same module for both versions then use a unique resource |
| 85 | +title and specify the `name` property. |
| 86 | + |
| 87 | +```puppet |
| 88 | +package { 'PSExcel-wps': |
| 89 | + ensure => latest, |
| 90 | + name => 'PSExcel', |
| 91 | + provider => 'windowspowershell', |
| 92 | + source => 'PSGallery', |
| 93 | +} |
| 94 | +
|
| 95 | +package { 'PSExcel-psc': |
| 96 | + ensure => latest, |
| 97 | + name => 'PSExcel', |
| 98 | + provider => 'powershellcore', |
| 99 | + source => 'PSGallery', |
44 | 100 | }
|
45 |
| -~~~ |
| 101 | +``` |
46 | 102 |
|
47 | 103 | ## Limitations
|
48 | 104 |
|
|
0 commit comments