You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Publish a prerelease version on every commit to the `main` branch, and a stable version once manually approved.
@@ -21,39 +21,82 @@ Use this template for your new git repository to get the following features out-
21
21
- A `.devcontainer` for use with Visual Studio Code's [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and [GitHub Codespaces](https://github.com/features/codespaces).
22
22
- Boilerplate repository files, such as ReadMe, License, Changelog, .gitignore, .editorconfig, PR and Issue templates, and more.
23
23
24
-
## 📄 Template setup instructions
24
+
## 🚀 Get started
25
25
26
-
Use this template to create a new repository for your PowerShell module.
27
-
Follow the instructions below to get started.
26
+
There are two ways to create your new PowerShell module repository:
27
+
28
+
1. Use the `New-PowerShellScriptModuleRepository` cmdlet to create a new repository, or
29
+
1. Create a new repository from this template in GitHub.
30
+
31
+
Both of these methods are described in more detail below.
32
+
33
+
Once the repository is created, follow the instructions in the repo's ReadMe file to complete the setup.
34
+
The non-transformed instructions can also be [viewed here](/src/Template.PowerShell.ScriptModule/TemplateRepoFiles/ReadMe.md).
35
+
36
+
## 📂 Method 1: Use the New-PowerShellScriptModuleRepository cmdlet
37
+
38
+
Step 1: Install the `Template.PowerShell.ScriptModule` module from the PowerShell Gallery:
The above command will create a new directory at `C:\MyModuleName` with the boilerplate files and workflows for publishing your module already set up.
51
+
52
+
You can then perform a `git init` in that directory and push it to where you want your git repository hosted (e.g. Azure DevOps or GitHub).
53
+
54
+
To complete the setup, follow the instructions in the repo's ReadMe file.
55
+
56
+
## 📄 Method 2: Create repository from GitHub template
57
+
58
+
If you repository will be hosted on GitHub, you can follow the steps below:
28
59
29
60
### 🗍 Step 1: Create a new repo from this template
30
61
31
62
The official docs for creating a new repository from a template can [be found here](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).
32
63
In short, the steps are:
33
64
34
65
1. Click the `Use this template` button at the top of the repository and choose `Create a new repository`.
35
-
1. Name your new repository (including your module name is a good idea) and give it a description.
66
+
1. Name your new repository (including your module's name is a good idea) and give it a description.
36
67
1. Click the `Create repository` button.
37
68
1. You should now have the new repository in your account with the name you chose.
38
69
1. Clone your new repository to your local machine to start making changes to it.
39
70
40
71
### 🤖 Step 2: Replace repo template information
41
72
42
73
Run the [_InitializeRepository.ps1](/_InitializeRepository.ps1) script to update the repository files with your module's information.
43
-
You will be prompted to enter the following information:
74
+
You will be prompted to enter some information, such as:
44
75
45
76
- Your module's name (no spaces)
46
77
- Your name or organization name (may contain spaces)
47
78
48
-
Once the script completes, most of the repo files will be replaced and there will be some additional steps to follow in the [new ReadMe file](/src/Template.PowerShell.ScriptModule/TemplateRepoFiles/ReadMe.md) that replaces this one.
79
+
Once the script completes, most of the repo files will be replaced.
80
+
You should commit the changes.
81
+
82
+
To complete the setup, follow the instructions in the repo's new ReadMe file (that replaced this one).
49
83
50
84
## 📋 Create your own template (optional)
51
85
52
-
Now that you have the repository looking the way you want, you may want to use it as a template for your future modules so that you don't have to make all of the same changes each time.
53
-
In GitHub, from the repo's `Settings` tab under the `General` section, you can rename the repository to reflect that it is a template and check the box to make it a `Template repository`.
86
+
Not happy with some of the default template configurations?
87
+
Maybe you don't like the .editorconfig settings, or want it to publish to your own internal PowerShell Gallery feed by default?
88
+
You can derive your own template from this repository and use it for your future modules, minimizing the custom changes you need to make every time you create a new repo.
89
+
90
+
To create your own template:
91
+
92
+
1. Fork [this repository on GitHub](https://github.com/deadlydog/Template.PowerShell.ScriptModule).
93
+
1. In GitHub, from your repo's `Settings` tab under the `General` section, rename the repository to reflect that it is a template and check the box to make it a `Template repository`.
94
+
1. Modify [the template repo files](/src/Template.PowerShell.ScriptModule/TemplateRepoFiles/) with whatever customizations you want.
95
+
1. If you are introducing more replacement tokens in the files, you will need to update the `Set-TemplateTokenValuesInAllRepositoryFiles` function in the [Template.PowerShell.ScriptModule.psm1](/src/Template.PowerShell.ScriptModule/Template.PowerShell.ScriptModule.psm1) file to handle them.
96
+
97
+
You can now create new repositories from your GitHub template in the same way you would use this one.
54
98
55
-
The caveat here is you have already ran the script that updated the repository files with your module's name and other information.
56
-
In your template repo, you would want to add instructions to do a find-and-replace on the repository files to update the module's name, and any other information you want changed for new modules created from your template.
99
+
If you want to be able to create new repositories from a module, you will need to publish your module under a different name.
0 commit comments