Skip to content

Commit 7292b79

Browse files
PsCustomObjectPsCustomObject
authored andcommitted
Fixed typo in text
1 parent cfafbfa commit 7292b79

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

_posts/2021-06-02-Setup-Internal-PowerShell-Repository.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tags:
1111

1212
toc: true
1313
header:
14-
teaser: "/assets/images/PowerShell_Logo.png"
14+
teaser: "/assets/images/PowerShell_Logo.png"
1515
---
1616

1717
## PowerShell repositories
@@ -20,9 +20,9 @@ If you follow my blog you probably know my [GitHub](https://github.com/PsCustomO
2020

2121
In my posts I often talked about [PowerShell Gallery](https://pscustomobject.github.io/powershell/tips/PowerShell-Restore-Default-Repository/) which you probably already used to install a module released by Microsoft or other developers.
2222

23-
Both are great tools when sharing code with a large audience over the internet, GitHub Private repositories are scope of this article, but a large chunk of my work involves developing *modules* that me and my colleagues user internally for automation purposes. These modules usually leverage technologies that are available only in my work environment and sometimes implement functions that would not have much sense outside my company.
23+
Both are great tools when sharing code with a large audience over the internet, GitHub Private repositories are scope of this article, but a large chunk of my work involves developing _modules_ that me and my colleagues user internally for automation purposes. These modules usually leverage technologies that are available only in my work environment and sometimes implement functions that would not have much sense outside my company.
2424

25-
One of the main issues we faced when initially started development of our own modules is ease of distribution to other team members for this reason we've setup internal **NuGet** repositories which can be used an *internal* PowerShell Gallery.
25+
One of the main issues we faced when initially started development of our own modules is ease of distribution to other team members for this reason we've setup internal **NuGet** repositories which can be used an _internal_ PowerShell Gallery.
2626

2727
## Required tools
2828

@@ -32,11 +32,11 @@ Here's what you will need to follow this article and setup your own PowerShell r
3232
- The ASP.NET and web development workload installed [here's](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio?view=vs-2019) a guide on how to modify an existing Visual Studio installation in case you don't have the appropriate workload installed already
3333
- A server running a supported copy of **Windows Server** I am using Windows 2019 but 2016 will do just fine
3434

35-
**Note:** If you do not have or cannot install Visual Studio at the end of the post I have posted a link to my [GitHub Repository](https://github.com/PsCustomObject/Nuget-PowerShell-Repository/tree/main/NuGetRepository/NuGetRepository)
35+
**Note:** If you do not have or cannot install Visual Studio at the end of the post I have posted a link to my [GitHub Repository](https://github.com/PsCustomObject/Nuget-PowerShell-Repository/tree/main/NuGetRepository/NuGetRepository)
3636

3737
## Create the Visual Studio Project
3838

39-
Once all requirements are in place open Visual Studio and create a project using the *ASP.Web Application (Visual C#)* template.
39+
Once all requirements are in place open Visual Studio and create a project using the _ASP.Web Application (Visual C#)_ template.
4040

4141
<figure>
4242
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/VS_Create_New_Project.png">
@@ -48,28 +48,28 @@ Once all requirements are in place open Visual Studio and create a project usin
4848
<img src="/assets/images/NugetArticle/VS_Web_Application.png"></a>
4949
</figure>
5050

51-
Application name is not important just avoid *NuGet* as this would create a conflict with one of the *packages* we need to install as part of the dependencies, in my example I've used **NuGetRepository** but it can really be anything
51+
Application name is not important just avoid _NuGet_ as this would create a conflict with one of the _packages_ we need to install as part of the dependencies, in my example I've used **NuGetRepository** but it can really be anything
5252

5353
<figure>
5454
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/Application_Configuration.png">
5555
<img src="/assets/images/NugetArticle/Application_Configuration.png"></a>
5656
</figure>
5757

58-
In the screen that will appear simply select the *Empty* template and then the *Create* button
58+
In the screen that will appear simply select the _Empty_ template and then the _Create_ button
5959

6060
<figure>
6161
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/Project_Configuration.png">
6262
<img src="/assets/images/NugetArticle/Project_Configuration.png"></a>
6363
</figure>
6464

65-
Once project has finished loading/being created *right-click* on the project name in *solution explorer* and select **Manage NuGet Packages**
65+
Once project has finished loading/being created _right-click_ on the project name in _solution explorer_ and select **Manage NuGet Packages**
6666

6767
<figure>
6868
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/Manage_NuGet_Package.png">
6969
<img src="/assets/images/NugetArticle/Manage_NuGet_Package.png"></a>
7070
</figure>
7171

72-
In the *NuGetRepository* window select the *Broswe* tab and search for package **NuGet.Server** and click on the **Install** button.
72+
In the _NuGetRepository_ window select the _Browse_ tab and search for package **NuGet.Server** and click on the **Install** button.
7373

7474
<figure>
7575
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/Install_NuGet_Component.png">
@@ -78,29 +78,29 @@ In the *NuGetRepository* window select the *Broswe* tab and search for package *
7878

7979
Keep I am using the latest stable release available at the time of this writing but you can select a different version of the package suiting your needs.
8080

81-
This step will take some time, depending on your connection speed, and a window showing you changes to the solution and asking your confirmation will appear in which case simply click on the *Ok* button.
81+
This step will take some time, depending on your connection speed, and a window showing you changes to the solution and asking your confirmation will appear in which case simply click on the _Ok_ button.
8282

83-
Once the installation step is complete I highly recommend to change the build type from *Debug*, default for new projects, to *Release* as this will disable all debug logging that is otherwise enabled for the solution.
83+
Once the installation step is complete I highly recommend to change the build type from _Debug_, default for new projects, to _Release_ as this will disable all debug logging that is otherwise enabled for the solution.
8484

8585
<figure>
8686
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/Set_Build_Type.png">
8787
<img src="/assets/images/NugetArticle/Set_Build_Type.png"></a>
8888
</figure>
8989

90-
Once this is done go to *Build / Build Solution* menu, or press F6 if you're lazy like me, to *package* together all files making up the solution.
90+
Once this is done go to _Build / Build Solution_ menu, or press F6 if you're lazy like me, to _package_ together all files making up the solution.
9191

92-
This will create a folder structure, under the path previously specified, containing all files required by the solution. Project path is visible in the **Properties** window under the *Project Folder* field
92+
This will create a folder structure, under the path previously specified, containing all files required by the solution. Project path is visible in the **Properties** window under the _Project Folder_ field
9393

9494
<figure>
9595
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/Project_Path.png">
9696
<img src="/assets/images/NugetArticle/Project_Path.png"></a>
9797
</figure>
9898

99-
**Note:** By default solution will be build under the C:\Users\username\source\repos\AppName\AppName\ path
99+
**Note:** By default solution will be build under the C:\Users\username\source\repos\AppName\AppName\ path
100100

101101
## Install required Server Components
102102

103-
Once the solution has been build in Visual Studio move on the server that will be hosting the repository and launch the following cmdlet from an elevated PowerShell session to install required *IIS* components
103+
Once the solution has been build in Visual Studio move on the server that will be hosting the repository and launch the following cmdlet from an elevated PowerShell session to install required _IIS_ components
104104

105105
```powershell
106106
# Splatted version
@@ -115,9 +115,9 @@ Install-WindowsFeature @paramInstallWindowsFeature
115115
Install-WindowsFeature Web-Server,Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Filter,Web-ISAPI-Ext -IncludeManagementTools
116116
```
117117

118-
Once all components are in place copy the solution files to a directory on the server with the default being *C:\inetpub\wwwroot*. Path is not really import and could be anything you'd like, I will just stick with the default.
118+
Once all components are in place copy the solution files to a directory on the server with the default being _C:\inetpub\wwwroot_. Path is not really import and could be anything you'd like, I will just stick with the default.
119119

120-
As a refrence here's how the content of my application folder looks like on my test server
120+
As a reference here's how the content of my application folder looks like on my test server
121121

122122
<figure>
123123
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/IIS_Application.png">
@@ -126,7 +126,7 @@ As a refrence here's how the content of my application folder looks like on my t
126126

127127
### Update Web.Config configuration file
128128

129-
The **web.config** file is located in the project root folder, assuming default path this will be *C:\inetpub\wwwroot\NuGetRepository*, open it with a text editor and under the **\<system.web\>** section you should see line similar the following (actual .Net Framework version could vary)
129+
The **web.config** file is located in the project root folder, assuming default path this will be _C:\inetpub\wwwroot\NuGetRepository_, open it with a text editor and under the **\<system.web\>** section you should see line similar the following (actual .Net Framework version could vary)
130130

131131
```xml
132132
<system.web>
@@ -147,11 +147,11 @@ Comment out or delete one of the instances of **\<compilation\>** tag so that re
147147
</system.web>
148148
```
149149

150-
**Note:** If the *web.config* file is not updated when opening the IIS Application an *Internal Server Error* message will be displayed an application won't work.
150+
**Note:** If the _web.config_ file is not updated when opening the IIS Application an _Internal Server Error_ message will be displayed an application won't work.
151151

152152
## Deploy Application to IIS
153153

154-
We can finally deploy the *NuGet* application to IIS to do so open **IIS Manager / Expand <Server Name> / Sites** right-click on Default Web Site and select **Add Application**
154+
We can finally deploy the _NuGet_ application to IIS to do so open **IIS Manager / Expand <Server Name> / Sites** right-click on Default Web Site and select **Add Application**
155155

156156
<figure>
157157
<a href="https://pscustomobject.github.io//assets/images/NugetArticle/Add_Application.png">
@@ -174,7 +174,7 @@ To test the configuration point your browser to **http://localhost/Nuget** which
174174

175175
### Configure Package Directory
176176

177-
In the default configuration packages are stored under the same path where the application lives in the *Packages* directory, in our example *C:\inetpub\wwwroot\Nuget\Packages*. This can be changed in the *web.config* configuration file via the following tag
177+
In the default configuration packages are stored under the same path where the application lives in the _Packages_ directory, in our example _C:\inetpub\wwwroot\Nuget\Packages_. This can be changed in the _web.config_ configuration file via the following tag
178178

179179
```xml
180180
<!--
@@ -186,23 +186,23 @@ In the default configuration packages are stored under the same path where the a
186186

187187
### Configure Repository API Key
188188

189-
Up to this point the repository is ready and can be used to *download* packages from it but if we need to *upload* data, in our example PowerShell modules, to it we would need some form of authentication which in NuGet is accomplished through an API key.
189+
Up to this point the repository is ready and can be used to _download_ packages from it but if we need to _upload_ data, in our example PowerShell modules, to it we would need some form of authentication which in NuGet is accomplished through an API key.
190190

191-
First of all generate a unique API key, I generally use a GUID generated via *New-Guid* cmdlet, open the *web.config* file and update the **apiKey** value as in the following example
191+
First of all generate a unique API key, I generally use a GUID generated via _New-Guid_ cmdlet, open the _web.config_ file and update the **apiKey** value as in the following example
192192

193193
```xml
194194
<!--
195-
Determines if an Api Key is required to push\delete packages from the server.
195+
Determines if an Api Key is required to push\delete packages from the server.
196196
-->
197197
<add key="requireApiKey" value="true" />
198-
<!--
198+
<!--
199199
Set the value here to allow people to push/delete packages from the server.
200200
NOTE: This is a shared key (password) for all users.
201201
-->
202202
<add key="apiKey" value="<GUID VALUE>" />
203203
```
204204

205-
If you want to disable authentication all together you can simply set the **requireApiKey** to *false*.
205+
If you want to disable authentication all together you can simply set the **requireApiKey** to _false_.
206206

207207
## Closing notes
208208

0 commit comments

Comments
 (0)