-
Notifications
You must be signed in to change notification settings - Fork 1
/
readme.md.source
57 lines (37 loc) · 2.71 KB
/
readme.md.source
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[![Build status](https://ci.appveyor.com/api/projects/status/fy38i5dvionpq2p9?svg=true)](https://ci.appveyor.com/project/alx9r/bootstraps)
# BootstraPS
The BootstraPS contains minimal scripts for bootstrapping the setup of more elaborate PowerShell configurations.
## Usage
BootstraPS is designed to have a very small footprint. To use the BootstrapPS command simply import `BootstraPS.psm1` in one of the following ways.
**from Disk**
If you already have `BootstraPS.psm1` on your computer, just imported it as follows:
```PowerShell
Import-Module .\BootstraPS.psm1
```
where `.\BootStraPS.psm1` is the path to the file on your computer.
**from Github**
You can also import `BootstraPS.psm1` directly from Github:
```PowerShell
__webloadPs1__
```
Note that the SHA512 hash of the file is checked prior to the call to `Import-Module` to confirm that the download is authentic.
Once the Bootstraps module is in-memory you can import modules directly from, for example, github.com:
```PowerShell
'Datum' | Import-WebModule @{
Datum = @{
Uri = 'https://github.com/gaelcolas/Datum/archive/555221cd828b1bc42425b6233389bd1b9d869597.zip'
Manifest = 'Datum.psd1'
}
@{
ModuleName='ProtectedData'
ModuleVersion = '4.1.0'
} = 'https://github.com/dlwyatt/ProtectedData/releases/download/4.1.0/ProtectedData.zip'
'powershell-yaml' = 'https://github.com/cloudbase/powershell-yaml/archive/9c693dfb71ffa00fe6dd171136e42ee7705ea363.zip'
}
```
There are a few notable things about this example. This particular revision of `Datum` requires `ProtectedData` version 4.1.0 which requires `powershell-yaml`. `Import-WebModule` works this out based on each module's module manifest and imports each module as necessary
`Datum` is still under development and has not yet incremented its version number (at the time this is being written). `powershell-yaml` has been released (it can be found using PowerShellGet's `Find-Module` command) but it is difficult to correlate the revision that you get using `Find-Module` with source code because the `powershell-yaml` project doesn't seem to use github releases or otherwise publish metadata that would make such correlation obvious.
The absence of official releases or metadata to correlate releases with source code seems to be commonplace for PowerShell modules, in particular for those that are new or under active development. To sidestep these problems we use `Uri`s for archives containing the particular revision. Because github automatically makes these available, using `Import-WebModule` does not depend on each project's release management practices to deploy the revision of module we need.
## Commands
BootstraPS exports the following commands:
__help__