Skip to content

Commit 7b5f096

Browse files
Merge pull request #10 from RandomNoun7/tickets/master/MODULES-6702-add-documentation
(MODULES_6702) Add Documentation
2 parents 973e5dd + 46281ad commit 7b5f096

File tree

1 file changed

+52
-19
lines changed

1 file changed

+52
-19
lines changed

README.md

+52-19
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
1. [Setup - The basics of getting started with powershellmodule](#setup)
77
* [Windows PowerShell](#windows-powershell)
88
* [PowerShell Core](#powershell-core)
9-
1. [Usage - Configuration options and additional functionality](#usage)
10-
* [Windows PowerShell](#windows-powershell)
11-
* [PowerShell Core](#powershell-core)
9+
1. [Usage](#usage)
10+
* [Register an internal PowerShell repository](#register-an-internal-powershell-repository)
11+
* [Use the PowerShell Gallery](#use-the-powershell-gallery)
1212
* [Side by side installation](#side-by-side-installation)
13-
1. [Limitations - OS compatibility, etc.](#limitations)
13+
* [The provider](#the-provider)
14+
1. [Reference](#reference)
15+
* [Types](#types)
16+
* [Providers](#providers)
1417
1. [Development - Guide for contributing to the module](#development)
1518

1619
## Description
@@ -38,9 +41,7 @@ PowerShellGet is included in PowerShell Core so no additional setup is necessary
3841

3942
## Usage
4043

41-
### Windows PowerShell
42-
43-
Windows users should remember that package names in Puppet are case sensitive.
44+
### Register an internal PowerShell repository
4445

4546
```puppet
4647
psrepository { 'my-internal-repo':
@@ -51,24 +52,21 @@ psrepository { 'my-internal-repo':
5152
}
5253
```
5354

55+
Manifests can then refer to that repository using the `package` resource.
56+
5457
```puppet
55-
package { 'Pester':
56-
ensure => '4.0.3',
57-
source => 'PSGallery',
58+
package { 'nameOfInternallyDevelopedModule':
59+
ensure => '1.0.5',
60+
source => 'my-internal-repo',
5861
provider => 'windowspowershell',
5962
}
6063
```
6164

62-
### PowerShell Core
65+
*Windows users should remember that package names in Puppet are case sensitive.
6366

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-
```
67+
### Use the PowerShell Gallery
68+
69+
You can install modules from the PowerShell Gallery by default once the [setup instructions](#Setup) have been followed. You do not need to specify the `PSGallery` with the `psrepository` type.
7270

7371
```puppet
7472
package { 'Pester':
@@ -100,11 +98,46 @@ package { 'PSExcel-psc':
10098
}
10199
```
102100

101+
### The provider
102+
103+
The provider to use will either be `windowspowershell` or `powershellcore`. Nodes using `powershell.exe` will use `windowspowershell`, and nodes that have PowerShell core (`pwsh.exe`) will use the `powershellcore` provider with both the `psrepository` and `package` types.
104+
103105
## Limitations
104106

105107
Note that PowerShell modules can be installed side by side so installing a newer
106108
version of a module will not remove any previous versions.
107109

110+
## Reference
111+
112+
### Types
113+
114+
### psrepository
115+
116+
Allows you to specify and configure a repository. The type expects a valid OneGet package provider source over an HTTP or HTTPS url.
117+
118+
#### Properties/Parameters
119+
120+
#### `name`
121+
122+
The name of the gallery to register on the computer. Must be unique. Cannot use `PSGallery` as the value for this property.
123+
124+
#### `source_location`
125+
126+
The url to the repository that you would like to register. Must be a valid HTTP or HTTPS url. This url will be used for the underlying `SourceLocation` property and will be used as the base url for `PublishLocation`, `ScriptSourceLocation`, `ScriptPublishLocation`. Cannot use the same url as the default gallery, PSGallery.
127+
128+
#### `installation_policy`
129+
130+
Manages the installation policy used for the PSRepository. Valid values are `trusted` or `untrusted`
131+
132+
### Providers
133+
#### `windowspowershell`
134+
135+
The provider for systems that have `powershell.exe` (PowerShell versions less than 6).
136+
137+
#### `powershellcore`
138+
139+
The provider for systems that use PowerShell core via `pwsh.exe`.
140+
108141
## Development
109142

110143
https://github.com/hbuckle/puppet-powershellmodule

0 commit comments

Comments
 (0)